Method and system for communicating between isolation environments

ABSTRACT

A method and system for associating installation scopes within an isolation environment, where the method includes defining an isolation environment for encompassing an aggregation of installation scopes. Associations are created between a first application and a first installation scope. When the first application requires the presence of a second application within the isolation environment for proper execution, an image of the required second application is mounted onto a second installation scope and an association between the second application and the second installation scope is created. Another association is created between the first installation scope and a second installation scope, and this third association is created within a third installation scope. Each of the first, second, and third installation scopes are stored and the first application is launched into the defined isolation environment.

FIELD OF THE INVENTION

This application relates generally to communication betweenapplications. In particular, the application relates to communicationbetween applications isolated from each other and located within anisolation environment.

BACKGROUND OF THE INVENTION

Solutions for alleviating problems with application sociability andcompatibility include those that isolate the execution of applicationssuch that the applications have access to a unique set of nativeresources specific to both the user executing the application and to theapplication. In some solutions, applications that require the presenceof additional applications during isolation are isolated withinisolation environments that include both an application executed by theuser and additional supporting applications that execute when theuser-executed application runs. Each time a main application requiresthe assistance of a supporting application, a new isolation environmentis created that includes both the main application and the supportingapplication. Resources used by supporting applications are re-generatedeach time an isolation environment that includes an instance of thesupporting application executes. Changes made to the resources by thesupporting applications are confined to the isolation environment withinwhich the change is made, and when a supporting application executes ina different isolation environment, the changes made are not preserved.Changes made to user-specified and application-specific resources by thesupporting applications are retained within the isolation environmentwhere the change is made, and when a supporting application executes ina different isolation environment, the changes made are not preserved.Rather changes are specific to the isolation environment within whichthe change is made, and application settings are not shared amongstmultiple instances of an application executing within the same usersession.

SUMMARY OF THE INVENTION

In one aspect, a system for aggregating installation scopes within anisolation environment, is shown and described. The system includes ameans for defining an isolation environment that is used to encompass anaggregation of installation scopes. The system also includes a means forcreates a first association between a first application and a firstinstallation scope. Prior to creation of the first association, arequest is made to execute the first application. The system furtherincludes a means for determining a requirement associated with the firstapplication, where this requirement identifies a requirement for thepresence of a second application within the isolation environment. Inresponse to this requirement, an image of the required secondapplication is mounted onto a second installation scope to create asecond association between the second application and the secondinstallation scope. The system includes a means for associating thefirst installation scope with the second installation scope, andcreating a third association between the aggregation of the firstinstallation scope and the second installation scope within a thirdinstallation scope. Each of the first association, the secondassociation, and the third association are stored by the system, and therequested first application is launched, by the system, into theisolation environment.

In one aspect, a system for retrieving native resources from a firstisolation environment is shown and described. The system includes ameans for intercepting a request for a native resource. Requests for thenative resource are generated by a first application associated with afirst installation scope that is included within the first isolationenvironment. A search is performed, using means provided by the system,within the first installation scope for a native resource thatcorresponds to the requested native resource. When there is a failure tolocate a corresponding native resource within the first installationscope, a determination is made, using means provided by the system, asto whether or not there is an association between the first installationscope and a second installation scope. The second installation scope canbe a representation of an image of a second application, where thesecond application is located within a second isolation environment. Thesystem includes a means for searching within the second installationscope, for a native resource that corresponds to the requested nativeresource. The system further retrieves an instance of the requestednative resource, located within the second isolation scope, and respondsto the request for the native resource that includes the retrievedinstance of the native resource.

In one aspect, a system for associating installation scopes tofacilitate updating instances of native resources, is shown anddescribed. The system includes a means for executing a first applicationwithin a first isolation environment, and a third application within asecond isolation environment. The system includes a means forintercepting a request for a native resource, where the native resourcecan be used in a third application that is associated with a thirdinstallation scope located within the second isolation environment. Afailure to locate the native resource within the third installationscope leads to determining, using a means provided by the system, anassociation between the third installation scope and a secondinstallation scope that represents an image of a second application. Thesystem further includes a means for retrieving an instance of therequest native resource that is located within the second installationscope. The retrieved instance of the requested native resource isupdated and returned to the second installation scope. Another requestto retrieve the native resource is intercepted by the system. Thisrequest is sent by the first application associated with a firstinstallation scope located within the first isolation environment. Afailure to locate, within the first installation scope, a nativeresource that corresponds to the requested native resource causes adetermination to be made, using a means provided by the system, as towhether or not an association between the first installation scope andthe second installation scope exists. If such an association exists,then the system retrieves an instance of the updated native resourcelocated within the second installation scope and returns the retrievedinstance to the first application.

In one aspect, an isolation environment for facilitating the transfer ofresource information between installation scopes is shown and described.The isolation environment includes a first installation scope thatrepresents a first application, where the first application executesaccording to an executable component within the first installationscope. Also included within the isolation environment is a secondinstallation scope that represents a second application. The secondinstallation scope is also associated with the first installation scopevia an aggregation of the first installation scope within the secondinstallation scope. A virtual scope is included within the isolationenvironment. The virtual scope represents an aggregation of the firstinstallation scope and the second installation scope. The virtual scopealso provides access to resource information located in the firstinstallation scope and resource information located in the secondinstallation scope.

In one aspect a method for retrieving user setting information from auser scope that contains an application profile, is shown and described.The method shown includes initializing a first isolation environmentthat includes a first installation scope associated with a firstapplication. The first isolation environment includes a user scope thatcontains a first application profile that further corresponds to thefirst application. User setting information associated with theconfiguration of the first application, is retrieved from the firstapplication profile. The first application executes within the firstisolation environment according to this retrieved user settinginformation. The method further includes initializing a second isolationenvironment with a second installation scope that is associated with thefirst application. The second isolation environment further includes auser scope that contains the first application profile. User settinginformation is retrieved from the first application profile and used toconfigure the first application. The first application is furtherexecuted within the second isolation environment according to theretrieved user setting information.

BRIEF DESCRIPTION OF THE DRAWINGS

The following figures depict illustrative embodiments of the method andsystem described herein. These figures are intended to illustrate andnot limit the method and system described herein.

FIG. 1A is a block diagram that illustrates an embodiment of aremote-access, networked environment with a client machine thatcommunicates with a server.

FIGS. 1B and 1C are block diagrams that illustrate an embodiment ofcomputing machines for practicing the methods and system describedherein.

FIG. 2A is a block diagram of an embodiment of a computing machine withan isolation environment.

FIG. 2B is a block diagram of an embodiment of a multi-user computingmachine with an isolation environment.

FIG. 2C is a flowchart of an embodiment of a method of launching anapplication into an isolation environment.

FIGS. 3A and 3B are flowcharts of an embodiment of a method ofaggregating instances of native resources into a single native resourceinstance.

FIG. 4 is a block diagram of an embodiment of a virtual scope.

FIG. 5 is a flowchart of an embodiment of a method of retrieving aninstance of a native resource.

FIG. 6A is a flowchart showing an embodiment of a method forvirtualizing access to native resources on a computing machine.

FIG. 6B is a flowchart showing an embodiment of a method for identifyinga replacement instance of a resource while in execute mode.

FIG. 6C is a flowchart showing an embodiment of a method for identifyinga literal resource when a request to open a native resource is receivedthat indicated the resource is being opened with the intention ofmodifying it.

FIG. 6D is a flowchart showing an embodiment of a method foridentifying, while in install mode, the literal resource when a requestto create a virtual resource is received.

FIG. 7 is a flowchart of an embodiment of a method for installing anapplication within an installation scope.

FIG. 8 is a flowchart depicting an embodiment of a method for opening anentry in a file system within the described virtualized environment.

FIG. 9 is a flowchart depicting an embodiment of a method for deletingan entry from a file system within the described virtualizedenvironment.

FIG. 10 is a flowchart depicting an embodiment of a method forenumerating entries in a file system within the described virtualizedenvironment.

FIG. 11 is a flowchart depicting an embodiment of a method for creatingan entry in a file system within the described virtualized environment.

FIG. 11A is a flowchart depicting an embodiment of a method for creatinga file entry in the file system within the described virtualizedenvironment.

FIG. 12 is a flowchart depicting an embodiment of a method for cyclingthrough more than one installation scope.

FIG. 13 is a flowchart depicting an embodiment of a method for cyclingthrough more than one installation scope.

FIG. 14 is a flowchart depicting an embodiment of a method for opening aregistry key within the described virtualized environment.

FIG. 15 is a flowchart depicting an embodiment of a method for deletinga registry key within the described virtualized environment.

FIG. 16 is a flowchart depicting an embodiment of a method forenumerating sub-keys of a key in a registry database within thedescribed virtualized environment.

FIG. 17 is a flowchart depicting an embodiment of a method for creatinga registry key in the described virtualized environment.

FIG. 18 is a flowchart depicting an embodiment of a method for cyclingthrough more than one installation scope.

FIG. 19 is a flowchart depicting an embodiment of a method for cyclingthrough more than one installation scope.

FIG. 20 is a flowchart depicting an embodiment of a method forvirtualizing access to named objects.

FIG. 21A is a block diagram of an embodiment of a multi-user computingmachine with an isolation environment.

FIG. 21B is a block diagram of an embodiment of a virtual scope.

FIG. 21C is a flowchart of an embodiment of a method of aggregatinginstances of native resources into a single native resource instance.

DETAILED DESCRIPTION

Computing Environment Providing Application Isolation

FIG. 1A illustrates one embodiment of a computing environment 101 thatincludes one or more client machines 102A-102N in communication withservers 106A-106N, and a network 104 installed in between the clientmachines 102A-102N and the servers 106A-106N. In some embodiments,client machines 102A-102N may be referred to as a single client machine102 or a single group of client machines 102, while servers 106 may bereferred to as a single server 106 or a single group of servers 106.Another embodiment includes a single client machine 102 communicatingwith more than one server 106; another embodiment includes a singleserver 106 communicating with more than one client machine 102. Yetanother embodiment includes a single client machine 102 communicatingwith a single server 106.

A client machine 102 within the computing environment may in someembodiments, be referenced by any one of the following terms: clientmachine(s) 102; client(s); client computer(s); client device(s); clientcomputing device(s); client node(s); endpoint(s); endpoint node(s);second machine; or any other naming convention that denotes a seconddevice connected to a first device such that operation of the seconddevice is dependent in part on operations performed by the first device.The server 106 in some embodiments may be referenced by any one of thefollowing terms: server(s), server farm(s), host computing device(s),first machine(s), or any other naming convention that denotes a firstdevice connected to a second device, where the first device can manage,at least in part, the operation of the second device.

The client machine 102 can in some embodiments execute, operate orotherwise provide an application that can be any one of the following:software; a program; executable instructions; a web browser; a web-basedclient; a client-server application; a thin-client computing client; anActiveX control; a Java applet; software related to voice over internetprotocol (VoIP) communications like a soft IP telephone; an applicationfor streaming video and/or audio; an application for facilitatingreal-time-data communications; a HTTP client; a FTP client; an Oscarclient; a Telnet client; or any other type and/or form of executableinstructions capable of executing on client machine 102. Still otherembodiments may include a computing environment 101 with an applicationthat is any of either server-based or remote-based, and an applicationthat is executed on the server 106 on behalf of the client machine 102.Further embodiments of the computing environment 101 include a server106 configured to display output graphical data to a client machine 102using a thin-client or remote-display protocol, where the protocol usedcan be any one of the following protocols: the Independent ComputingArchitecture (ICA) protocol manufactured by Citrix Systems, Inc. of Ft.Lauderdale, Fla.; or the Remote Desktop Protocol (RDP) manufactured bythe Microsoft Corporation of Redmond, Wash.

The computing environment 101 can, in some embodiments, include morethan one server 106A-106N where the servers 106A-106N are: groupedtogether as a single server 106 entity, logically-grouped together in aserver farm 106; geographically dispersed and logically grouped togetherin a server farm 106, located proximate to each other and logicallygrouped together in a server farm 106. Geographically dispersed servers106A-106N within a server farm 106 can, in some embodiments, communicateusing a WAN, MAN, or LAN, where different geographic regions can becharacterized as: different continents; different regions of acontinent; different countries; different states; different cities;different campuses; different rooms; or any combination of the precedinggeographical locations. In some embodiments the server farm 106 may beadministered as a single entity or in other embodiments may includemultiple server farms 106. The computing environment 101 can includemore than one server 106A-106N grouped together in a single server farm106 where the server farm 106 is heterogeneous such that one server106A-106N is configured to operate according to a first type ofoperating system platform (e.g., WINDOWS NT, manufactured by MicrosoftCorp. of Redmond, Wash.), while one or more other servers 106A-106N areconfigured to operate according to a second type of operating systemplatform (e.g., Unix or Linux); more than one server 106A-106N isconfigured to operate according to a first type of operating systemplatform (e.g., WINDOWS NT), while another server 106A-106N isconfigured to operate according to a second type of operating systemplatform (e.g., Unix or Linux); or more than one server 106A-106N isconfigured to operate according to a first type of operating systemplatform (e.g., WINDOWS NT) while more than one of the other servers106A-106N are configured to operate according to a second type ofoperating system platform (e.g., Unix or Linux).

The computing environment 101 can in some embodiments include a server106 or more than one server 106 configured to provide the functionalityof any one of the following server types: a file server; an applicationserver; a web server; a proxy server; an appliance; a network appliance;a gateway; an application gateway; a gateway server; a virtualizationserver; a deployment server; a SSL VPN server; a firewall; a web server;an application server or as a master application server; a server 106configured to operate as an active direction; a server 106 configured tooperate as application acceleration application that provides firewallfunctionality, application functionality, or load balancingfunctionality, or other type of computing machine configured to operateas a server 106. In some embodiments, a server 106 may include a remoteauthentication dial-in user service such that the server 106 is a RADIUSserver. Embodiments of the computing environment 101 where the server106 comprises an appliance, the server 106 can be an appliancemanufactured by any one of the following manufacturers: the CitrixApplication Networking Group; Silver Peak Systems, Inc; RiverbedTechnology, Inc.; F5 Networks, Inc.; or Juniper Networks, Inc. Someembodiments include a server 106 with the following functionality: afirst server 106A that receives requests from a client machine 102,forwards the request to a second server 106B, and responds to therequest generated by the client machine with a response from the secondserver 106B; acquires an enumeration of applications available to theclient machines 102 and address information associated with a server 106hosting an application identified by the enumeration of applications;presents responses to client requests using a web interface;communicates directly with the client 102 to provide the client 102 withaccess to an identified application; receives output data, such asdisplay data, generated by an execution of an identified application onthe server 106.

The server 106 can be configured to execute any one of the followingapplications: an application providing a thin-client computing or aremote display presentation application; any portion of the CITRIXACCESS SUITE by Citrix Systems, Inc. like the METAFRAME or CITRIXPRESENTATION SERVER; MICROSOFT WINDOWS Terminal Services manufactured bythe Microsoft Corporation; or an ICA client, developed by CitrixSystems, Inc. Another embodiment includes a server 106 configured toexecute an application so that the server may function as an applicationserver such as any one of the following application server types: anemail server that provides email services such as MICROSOFT EXCHANGEmanufactured by the Microsoft Corporation; a web or Internet server; adesktop sharing server; or a collaboration server. Still otherembodiments include a server 106 that executes an application that isany one of the following types of hosted server applications:GOTOMEETING provided by Citrix Online Division, Inc.; WEBEX provided byWebEx, Inc. of Santa Clara, Calif.; or Microsoft Office LIVE MEETINGprovided by Microsoft Corporation.

Client machines 102 may function, in some embodiments, as a client nodeseeking access to resources provided by a server 106, or as a server 106providing other clients 102A-102N with access to hosted resources. Oneembodiment of the computing environment 101 includes a server 106 thatprovides the functionality of a master node. Communication between theclient machine 102 and either a server 106 or servers 106A-106N can beestablished via any of the following methods: direct communicationbetween a client machine 102 and a server 106A-106N in a server farm106; a client machine 102 that uses a program neighborhood applicationto communicate with a server 106 a-106 n in a server farm 106; or aclient machine 102 that uses a network 104 to communicate with a server106A-106N in a server farm 106. One embodiment of the computingenvironment 101 includes a client machine 102 that uses a network 104 torequest that applications hosted by a server 106A-106N in a server farm106 execute, and uses the network 104 to receive from the server106A-106N graphical display output representative of the applicationexecution. In other embodiments, a master node provides thefunctionality required to identify and provide address informationassociated with a server 106 hosting a requested application. Stillother embodiments include a master node that can be any one of thefollowing: a server 106A-106N within the server farm 106; a remotecomputing machine connected to the server farm 106 but not includedwithin the server farm 106; a remote computing machine connected to aclient 102 but not included within a group of client machines 102; or aclient machine 102.

The network 104 between the client machine 102 and the server 106 is aconnection over which data is transferred between the client machine 102and the server 106. Although the illustration in FIG. 1A depicts anetwork 104 connecting the client machines 102 to the servers 106, otherembodiments include a computing environment 101 with client machines 102installed on the same network as the servers 106. Other embodiments caninclude a computing environment 101 with a network 104 that can be anyof the following: a local-area network (LAN); a metropolitan areanetwork (MAN); a wide area network (WAN); a primary network 104comprised of multiple sub-networks 104′ located between the clientmachines 102 and the servers 106; a primary public network 104 with aprivate sub-network 104′; a primary private network 104 with a publicsub-network 104′; or a primary private network 104 with a privatesub-network 104′. Still further embodiments include a network 104 thatcan be any of the following network types: a point to point network; abroadcast network; a telecommunications network; a data communicationnetwork; a computer network; an ATM (Asynchronous Transfer Mode)network; a SONET (Synchronous Optical Network) network; a SDH(Synchronous Digital Hierarchy) network; a wireless network; a wirelinenetwork; a network 104 that includes a wireless link where the wirelesslink can be an infrared channel or satellite band; or any other networktype able to transfer data from client machines 102 to servers 106 andvice versa to accomplish the methods and systems described herein.Network topology may differ within different embodiments, possiblenetwork topologies include: a bus network topology; a star networktopology; a ring network topology; a repeater-based network topology; atiered-star network topology; or any other network topology abletransfer data from client machines 102 to servers 106, and vice versa,to accomplish the methods and systems described herein. Additionalembodiments may include a network 104 of mobile telephone networks thatuse a protocol to communicate among mobile devices, where the protocolcan be any one of the following: AMPS; TDMA; CDMA; GSM; GPRS UMTS; orany other protocol able to transmit data among mobile devices toaccomplish the systems and methods described herein.

Illustrated in FIG. 1B is an embodiment of a computing device 100 thatcan function as a client machine 102 and a server 106 illustrated inFIG. 1A. Included within the computing device 100 is a system bus 150that communicates with the following components: a central processingunit 121; a main memory 122; storage memory 128; an input/output (I/O)controller 123; display devices 124A-124N; an installation device 116;and a network interface 118. In one embodiment, the storage memory 128includes: an operating system, software routines, and a client agent120. The I/O controller 123, in some embodiments, is further connectedto a key board 126, and a pointing device 127. Other embodiments mayinclude an I/O controller 123 connected to more than one input/outputdevice 130A-130N.

FIG. 1C illustrates an embodiment of a computing device 100, that canfunction as a client machine 102 and a server 106. Included within thecomputing device 100 is a system bus 150 that communicates with: abridge 170, and a first I/O device 130A. In another embodiment, thebridge 170 is in further communication with the central processing unit121, where the central processing unit 121 can further communicate witha second I/O device 130B, a main memory 122, and a cache memory 140.Included within the central processing unit 121, are I/O ports, a memoryport 103, and a main processor.

Embodiments of the computing machine 100 can include a centralprocessing unit 121 characterized by any one of the following componentconfigurations: logic circuits that respond to and process instructionsfetched from the main memory unit 122; a microprocessor unit, such as:those manufactured by Intel Corporation; those manufactured by MotorolaCorporation; those manufactured by Transmeta Corporation of Santa Clara,Calif.; the RS/6000 processor such as those manufactured byInternational Business Machines; a processor such as those manufacturedby Advanced Micro Devices; or any other combination of logic circuitscapable of executing the systems and methods described herein. Stillother embodiments of the central processing unit 122 may include anycombination of the following: a microprocessor, a microcontroller, acentral processing unit with a single processing core, a centralprocessing unit with two processing cores, or a central processing unitwith more than one processing cores.

One embodiment of the computing machine 100 includes a centralprocessing unit 121 that communicates with cache memory 140 via asecondary bus also known as a backside bus, while another embodiment ofthe computing machine 100 includes a central processing unit 121 thatcommunicates with cache memory via the system bus 150. The local systembus 150 can, in some embodiments, also be used by the central processingunit to communicate with more than one type of I/O devices 130A-130N. Insome embodiments, the local system bus 150 can be any one of thefollowing types of buses: a VESA VL bus; an ISA bus; an EISA bus; aMicroChannel Architecture (MCA) bus; a PCI bus; a PCI-X bus; aPCI-Express bus; or a NuBus. Other embodiments of the computing machine100 include an I/O device 130A-130N that is a video display 124 thatcommunicates with the central processing unit 121 via an AdvancedGraphics Port (AGP). Still other versions of the computing machine 100include a processor 121 connected to an I/O device 130A-130N via any oneof the following connections: HyperTransport, Rapid I/O, or InfiniBand.Further embodiments of the computing machine 100 include a communicationconnection where the processor 121 communicates with one I/O device 130Ausing a local interconnect bus and with a second I/O device 130B using adirect connection.

Included within some embodiments of the computing device 100 is each ofa main memory unit 122 and cache memory 140. The cache memory 140 can,in some embodiments, be any one of the following types of memory: SRAM;BSRAM; or EDRAM. Other embodiments include cache memory 140 and a mainmemory unit 122 that can be any one of the following types of memory:Static random access memory (SRAM), Burst SRAM or SynchBurst SRAM(BSRAM), Dynamic random access memory (DRAM), Fast Page Mode DRAM (FPMDRAM), Enhanced DRAM (EDRAM), Extended Data Output RAM (EDO RAM),Extended Data Output DRAM (EDO DRAM), Burst Extended Data Output DRAM(BEDO DRAM), Enhanced DRAM (EDRAM), synchronous DRAM (SDRAM), JEDECSRAM, PC100 SDRAM, Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM(ESDRAM), SyncLink DRAM (SLDRAM), Direct Rambus DRAM (DRDRAM),Ferroelectric RAM (FRAM), or any other type of memory device capable ofexecuting the systems and methods described herein. The main memory unit122 and/or the cache memory 140 can in some embodiments include one ormore memory devices capable of storing data and allowing any storagelocation to be directly accessed by the central processing unit 121.Further embodiments include a central processing unit 121 that canaccess the main memory 122 via one of either: a system bus 150; a memoryport 103; or any other connection, bus or port that allows the processor121 to access memory 122.

One embodiment of the computing device 100 provides support for any oneof the following installation devices 116: a floppy disk drive forreceiving floppy disks such as 3.5-inch, 5.25-inch disks or ZIP disks, aCD-ROM drive, a CD-R/RW drive, a DVD-ROM drive, tape drives of variousformats, USB device, a bootable medium, a bootable CD, a bootable CD forGNU/Linux distribution such as KNOPPIX®, a hard-drive or any otherdevice suitable for installing applications or software. Applicationscan in some embodiments include a client agent 120, or any portion of aclient agent 120. The computing device 100 may further include a storagedevice 128 that can be either one or more hard disk drives, or one ormore redundant arrays of independent disks; where the storage device isconfigured to store an operating system, software, programsapplications, or at least a portion of the client agent 120. A furtherembodiment of the computing device 100 includes an installation device116 that is used as the storage device 128.

Furthermore, the computing device 100 may include a network interface118 to interface to a Local Area Network (LAN), Wide Area Network (WAN)or the Internet through a variety of connections including, but notlimited to, standard telephone lines, LAN or WAN links (e.g., 802.11,T1, T3, 56 kb, X.25, SNA, DECNET), broadband connections (e.g., ISDN,Frame Relay, ATM, Gigabit Ethernet, Ethernet-over-SONET), wirelessconnections, or some combination of any or all of the above. Connectionscan also be established using a variety of communication protocols(e.g., TCP/IP, IPX, SPX, NetBIOS, Ethernet, ARCNET, SONET, SDH, FiberDistributed Data Interface (FDDI), RS232, RS485, IEEE 802.11, IEEE802.11a, IEEE 802.11b, IEEE 802.11g, CDMA, GSM, WiMax and directasynchronous connections). One version of the computing device 100includes a network interface 118 able to communicate with additionalcomputing devices 100′ via any type and/or form of gateway or tunnelingprotocol such as Secure Socket Layer (SSL) or Transport Layer Security(TLS), or the Citrix Gateway Protocol manufactured by Citrix Systems,Inc. Versions of the network interface 118 can comprise any one of: abuilt-in network adapter; a network interface card; a PCMCIA networkcard; a card bus network adapter; a wireless network adapter; a USBnetwork adapter; a modem; or any other device suitable for interfacingthe computing device 100 to a network capable of communicating andperforming the methods and systems described herein.

Embodiments of the computing device 100 include any one of the followingI/O devices 130A-130N: a keyboard 126; a pointing device 127; mice;trackpads; an optical pen; trackballs; microphones; drawing tablets;video displays; speakers; inkjet printers; laser printers; anddye-sublimation printers; or any other input/output device able toperform the methods and systems described herein. An I/O controller 123may in some embodiments connect to multiple I/O devices 103A-130N tocontrol the one or more I/O devices. Some embodiments of the I/O devices130A-130N may be configured to provide storage or an installation medium116, while others may provide a universal serial bus (USB) interface forreceiving USB storage devices such as the USB Flash Drive line ofdevices manufactured by Twintech Industry, Inc. Still other embodimentsof an I/O device 130 may be a bridge between the system bus 150 and anexternal communication bus, such as: a USB bus; an Apple Desktop Bus; anRS-232 serial connection; a SCSI bus; a FireWire bus; a FireWire 800bus; an Ethernet bus; an AppleTalk bus; a Gigabit Ethernet bus; anAsynchronous Transfer Mode bus; a HIPPI bus; a Super HIPPI bus; aSerialPlus bus; a SCI/LAMP bus; a FibreChannel bus; or a Serial Attachedsmall computer system interface bus.

In some embodiments, the computing machine 100 can connect to multipledisplay devices 124A-124N, in other embodiments the computing device 100can connect to a single display device 124, while in still otherembodiments the computing device 100 connects to display devices124A-124N that are the same type or form of display, or to displaydevices that are different types or forms. Embodiments of the displaydevices 124A-124N can be supported and enabled by the following: one ormultiple I/O devices 130A-130N; the I/O controller 123; a combination ofI/O device(s) 130A-130N and the I/O controller 123; any combination ofhardware and software able to support a display device 124A-124N; anytype and/or form of video adapter, video card, driver, and/or library tointerface, communicate, connect or otherwise use the display devices 124a-124 n. The computing device 100 may in some embodiments be configuredto use one or multiple display devices 124A-124N, these configurationsinclude: having multiple connectors to interface to multiple displaydevices 124 a-124 n; having multiple video adapters, with each videoadapter connected to one or more of the display devices 124A-124N;having an operating system configured to support multiple displays124A-124N; using circuits and software included within the computingdevice 100 to connect to and use multiple display devices 124A-124N; andexecuting software on the main computing device 100 and multiplesecondary computing devices to enable the main computing device 100 touse a secondary computing device's display as a display device 124A-124Nfor the main computing device 100. Still other embodiments of thecomputing device 100 may include multiple display devices 124A-124Nprovided by multiple secondary computing devices and connected to themain computing device 100 via a network.

In some embodiments of the computing machine 100, an operating systemmay be included to control task scheduling and access to systemresources. Embodiments of the computing device 100 can run any one ofthe following operation systems: versions of the MICROSOFT WINDOWSoperating systems such as WINDOWS 3.x; WINDOWS 95; WINDOWS 98; WINDOWS2000; WINDOWS NT 3.51; WINDOWS NT 4.0; WINDOWS CE; WINDOWS XP; andWINDOWS VISTA; the different releases of the Unix and Linux operatingsystems; any version of the MAC OS manufactured by Apple Computer; OS/2,manufactured by International Business Machines; any embedded operatingsystem; any real-time operating system; any open source operatingsystem; any proprietary operating system; any operating systems formobile computing devices; or any other operating system capable ofrunning on the computing device and performing the operations describedherein. One embodiment of the computing machine 100 has multipleoperating systems installed thereon.

The computing machine 100 can be embodied in any one of the followingform factors: a computing workstation; a desktop computer; a laptop ornotebook computer; a server; a handheld computer; a mobile telephone; aportable telecommunication device; a media playing device; a gamingsystem; a mobile computing device; a device of the IPOD family ofdevices manufactured by Apple Computer; any one of the PLAYSTATIONfamily of devices manufactured by the Sony Corporation; any one of theNintendo family of devices manufactured by Nintendo Co; any one of theXBOX family of devices manufactured by the Microsoft Corporation; or anyother type and/or form of computing, telecommunications or media devicethat is capable of communication and that has sufficient processor powerand memory capacity to perform the methods and systems described herein.In other embodiments the computing machine 100 can be a mobile devicesuch as any one of the following mobile devices: a JAVA-enabled cellulartelephone or personal digital assistant (PDA), such as the i55sr, i58sr,i85s, i88s, i90c, i95cl, or the im1100, all of which are manufactured byMotorola Corp; the 6035 or the 7135, manufactured by Kyocera; the i300or i330, manufactured by Samsung Electronics Co., Ltd; the TREO 180,270, 600, 650, 680, 700p, 700w, or 750 smart phone manufactured by Palm,Inc; any computing device that has different processors, operatingsystems, and input devices consistent with the device; or any othermobile computing device capable of performing the methods and systemsdescribed herein. Still other embodiments of the computing environment101 include a mobile computing device 100 that can be any one of thefollowing: any one series of Blackberry, or other handheld devicemanufactured by Research In Motion Limited; the iPhone manufactured byApple Computer; any handheld or smart phone; a Pocket PC; a Pocket PCPhone; or any other handheld mobile device supporting Microsoft WindowsMobile Software.

As referred to herein, a scope can be any one of an installation scope,a system scope, a user scope, an application-specific user scope, anisolation scope, or a scope. A system scope, in one embodiment, refersto a scope located in the system root within the operating system. Thesystem scope, in this embodiment, can include the native resourcesassociated with the computing machine 200. An installation scope, in oneembodiment, refers to a scope that includes the native resourcesassociated with an application. Other embodiments include installationscopes that can include any of the following: instances of nativeresources used by an application associated with the installation scope;an instance of the application associated with the installation scope; aset of native resources used by an application associated with theinstallation scope; more than one set of native resources or set ofnative resource instances associated with the one or more applications,application associations, or application instances included in theinstallation scope; or a set of application-specific settings andconfigurations. The user scope can, in some embodiments, be a scope thatincludes an instance of native resources that correspond touser-specific settings and configurations. An application-specific userscope includes native resources specific to a type of application, wherethe settings are determined by user input. One example of nativeresource instances within an application-specific user scope includesuser-settings for the Microsoft Word application. An isolation scope canbe any scope included within an isolation environment, or any scope thataids in isolating an application within an environment. Examples ofisolation scopes include an installation scope, a user scope, and anapplication specific scope. In certain embodiments, the system scope mayalso be an isolation scope. A scope is, in some embodiments, a groupingof native resources, settings, and configurations that are used by oneor more applications to execute. Other embodiments include a scope withinstances of native resources, while still other embodiments includescopes with instances of native resources, and instances of one or moreapplications associated with the scope. In some embodiments, scopes canfurther include sub-scopes, and scope can further encompass more thanone individual scope.

Illustrated in FIG. 2A is one embodiment of a computing machine 200within a computing environment, where the computing machine 200 operateswith reduced application compatibility and application sociability.Installed on the computing machine 200 is an operating system 210 whichis in further communication with one or more applications 203,“Application 1” 202 and “Application 2” 204. Within the operating system210 is a system root 216, an installation root 214, and a user root 212.Together, the installation root 214 and the user root 212 reside in anisolation environment 260 also located in the operating system 210.Within the installation root 214 are individual installation scopes 230such as: “Installation Scope 1” 224; “Installation Scope 2” 226; and“Installation Scope 3” 228.

Further referring to FIG. 2A and in more detail, embodiments can includea computing machine 200 that provides an isolation environment 260 tomitigate application compatibility and application sociability.Application compatibility problems arise when more than one applicationor instance of a similar application, are executed on a computingmachine 200 by one or more users. These applications often utilizesimilar native resources stored on the computing machine 200 within thesystem root 216. When one application manipulates or otherwise alters anative resource, the execution of a second application or secondinstance of the first application can be compromised when the secondapplication or application instance utilizes the same native resourcethat was just altered. Proper execution of this secondapplication/application instance may require the native resource to bein a particular form or to have a particular value. Applicationsociability is a similar concept in that when more than one applicationor instance of an application is executed on a computing machine 200,proper execution of each application and application instance requiresaccess to particular native resources. When these required nativeresources are common amongst applications and application instances,problems can arise regarding the ability of an application to haveaccess to a native resource with the proper value and form.

In one embodiment, the computing machine 200 is a client computingmachine 102 configured to communicate with a server 106 via a network104. Another embodiment includes a computing machine 200 that is aserver 106 able to communicate with a client machine 102 via a network.Still other embodiments include a computing machine 200 that can be anyone of the above configurations of a computing machine.

The operating system 210, in one embodiment, is a program applicationinstalled on the computing machine 200 to control the operation ofcomponents included within the computing machine 200. In otherembodiments, the operating system 210 can be any combination of theabove described operating systems.

Applications 203 on the computing machine 200 can, in one embodiment,communicate with the operating system 210. In other embodiments,applications 203 can communicate directly with components included inthe computing machine 200, or the applications 203 do not communicatewith the operating system 210. One embodiment includes a singleapplication 202 can communicate with the operating system 210, ormultiple applications 203 can communicate with the operating system 210.Still other embodiments include applications 203 that can be anyprogram, routine, set of commands, or other software application.

In one embodiment, a system root 216 is included. The system root 216provides a set of native resources that are specific to the computingmachine 200. Another embodiment includes a system root 216 with nativeresources that are substantially similar to those native resourcespresent on the computing machine 200 when only the operation system 210is installed on the computing machine 200.

One embodiment includes an installation root 214 that groups togetherindividual installation scopes 230. In one embodiment, the installationroot 214 groups together individual installation scopes 230 that areassociated according to the requirements of applications isolated ineach of the installation scopes 230. In another embodiment, theinstallation root 214 groups together individual installation scopes 230according to any one of the following: application policies, applicationsettings, installation root 214 settings, installation scope 230settings, or any other criteria that may be used to identifyinstallation scope 230 that are be grouped together in a singleinstallation root 214. The installation root 214 provides, in oneembodiment, application isolation, where the isolation providedmitigates the problems associated with application sociability andcompatibility. Still another embodiment includes an installation root214 with a main base installation scope and additional installationscopes configured to act like sub-scopes of the main base installationscope. In this embodiment, an installation scope contains modificationsto the main base installation scope, where the modifications can be achange in the patch level of the application, or the installation orremoval of additional application features.

Many embodiments include installation scopes 230 within the installationroot 214. Each installation scope 230 includes an instance of the nativeresources associated with a particular application. For example, a firstapplication may be installed within a first installation scope 224.Included in this first installation scope 224 would be instances of thenative resources specific to the first application installed within thefirst installation scope 224. In one embodiment, the installation scopes230 each include a view of native resources specific to an application203. For example, the native resources specific to a first application202 may be represented in a first installation scope 224, while thenative resources specific to a second application 204 may be representedin a second installation scope 226. Other embodiments may include athird installation scope 228 associated with the first installationscope 224 and the second installation scope 226, such that both thefirst application 202 and the second application 204 may access andmanipulate the view of native resources included in the thirdinstallation scope 228. Still other embodiments include applications 203that are grouped together such that a single installation scope 230would provide a specific view of the native resources for each group ofapplications 203. In this embodiment, conflicting applications 203 canbe separated into different groups to enhance the compatibility andsociability of applications. In still further embodiments, theapplications belonging to an application group, may be configured by anadministrator. In some embodiments, a “pass through” installation scopecan be defined which corresponds exactly to instances of nativeresources included in the system root 216. In other words, applicationsexecuting within a pass through installation scope operate directly onthose native resources included in the system root 216. In someembodiments, installation scopes are made visible to an instance of theexecuting application such that the visible installation scopes may beconfigured by the executing application. In other embodiments, a set ofvisible installation scopes includes a set of native resource instancesthat is common to all instances of the executing application regardlessof the user on behalf of which the application is executing. Still otherembodiments include a set of visible installation scopes with variablesets of native resource instances, that vary based on the user executingthe application. One embodiment includes installation scopes 230, whereadditional installation scopes 230 may execute within the installationroot 214 based on user-defined parameters. These parameters can includeinstructions as to which installation scope should execute, or operatinginstructions that have the effect of executing some installation scopes230 but not others. In some embodiments, installation scopes may bediscarded when no longer needed, while in other embodiments,installation scopes 230 may be merged into a single installation scope230 that includes an instance of the native resources that isrepresentative of the individual native resource instances included ineach individual installation scope.

Still referring to FIG. 2A, in one embodiment, a user root 212 isincluded to store and present instances of native resourcesrepresentative of user-defined setting and configuration information. Insome embodiments the user root 212 can include instances of nativeresources that are utilized by applications 203 to initialize based onuser-defined settings. One embodiment includes an isolation environment260 that does not include a user root 212, while another embodimentincludes an installation root 214 that includes a scope substantiallysimilar to the scope included in the user root 212. Still otherembodiments include a user root 212 with an instance of native resourcesthat combines both the application-specific settings and configurationsincluded in the installation root 214 with user-defined settings andconfigurations.

An isolation environment 260 is included, in one embodiment that furtherincludes a user root 212 and an installation root 214. Other embodimentscan include an isolation environment 260 with any one of the followingcharacteristics: an isolation environment 260 with more than one userroot 212; an isolation environment 260 with more than one installationroot 214; an isolation environment 260 that includes a user root 212, aninstallation root 214, and a system root 216; an isolation environment260 that includes an installation root 214 and a system root 216; anisolation environment 260 that includes a user root 212 and a systemroot 216; an isolation environment 260 that includes a user root 212; anisolation environment 260 that includes a system root 216; an isolationenvironment 260 that includes an installation root 214; an isolationenvironment 260 that includes an additional scope or root (notillustrated); or an isolation environment 260 that includes multipleinstallation scopes and user roots grouped together based on either userprofiles or application profiles. In one embodiment, the isolationenvironment 260 provides isolation to an executing application byisolating the native resources specific to that application and to theuser executing the application. Isolation of the native resourcesspecific to the application includes presenting those instances of thenative resources included within the installation root 214 and the userroot 212, to the executing application, rather than allowing theapplication to access and manipulate the native resources in the systemroot 216. Native resources may differ between applications, sopresenting an executing application with its own set of unique nativeresources mitigates application un-compatibility and non-sociability.

Illustrated in FIG. 2B is an embodiment configured to provide access tomore than one user 238, 240, 242 and having reduced applicationcompatibility and application sociability problems. The illustratedcomputing machine 200 has the following: an operating system 210installed thereon; user sessions 238, 240, 242 indicative of useractions; and applications 202, 204, 206, 208 executing within the usersessions 238, 240, 242. The operating system 210 has a system root 216,an installation root 214, and a user root 211. Included within thesystem root 216 is a system scope 256 that further includes nativeresources 258 such as: a file system 218; a registry 220; and objects222. The installation root 214 includes more than one installation scope244, 246, 252, 248, 250, 254, where each installation scope is connectedto another scope. Included within each installation scope are instancesof native resources 258′, 258″, 258′″, 258″″, 258′″″, 258″″″. The userroot 212 includes more than one user scope 232, 234, 236, where eachscope is associated with a user session 238, 240, 242 and each scopeincludes an instance of native resources. An isolation environment 260is included within the operating system 210 that groups together theuser root 212 and the installation root 214.

Further referring to FIG. 2B and in more detail, in one embodiment, thecomputing machine 200 can be any combination of the above describedcomputing machine 100. In another embodiment, the operating system 210installed thereon can be any combination of the above describedoperating system. Still other embodiments can include applications 202,204, 206, 208, where an application can be any one of the following: asoftware program installed on the computing machine 200; an applicationaccessed remotely by the computing machine 200; a set of softwarecommands sent to the operating system 210; a software routine; anoperating system; or any other application that can be executed on thecomputing machine 200. In one embodiment, the computing machine 200 canfunction as a client machine 102 or as a server 106.

Embodiments can include an operating system 210 that further includes asystem root 216. The system root 216, in one embodiment, furtherincludes a system scope 256 within which native resources 258 aregrouped. Other embodiments may include a system root 216 with nativeresources 258 that are grouped together within the system root 216.Still other embodiments may include an operating system 210 without asystem root 216, and with a grouping of system native resources 258located within the operating system 210. Native resources 258 may not begrouped together, but may be dispersed throughout any one of the systemroot 216, the system scope 256, or the operating system 210. Oneembodiment includes a system root 216 with multiple system scopes (notillustrated), where each system scope would have a unique set of nativeresource instances.

In one embodiment, the group of native resources 258 and the instancesof native resources are any of the following resource types: a filesystem 218; a registry 220; system objects 222; window names; or anyother native resource useful to the proper execution of an application.Native resources 258 are requested by applications 202, 204, 206, 208when the application requires a particular resource to execute properly.For example, an application may require a particular setting stored in aregistry key to execute a portion of the application. Execution of theportion of the application dictates that the application request fromthe registry 220, the key containing the required setting. Someembodiments include groups of native resources 258 where the group cancontain one or more than one native resource, or groups of nativeresources 258 with differing native resource types. Other embodimentscan include any one of the following combinations: a system scope withnative resources 258, user scopes with instances of native resources258, and installation scopes with instances of native resources 258; asystem scope with native resources 258, and installation scopes withinstances of native resources 258; a system scope with native resources258, and user scopes with instances of native resources 258; a systemscope with instances of native resources 258, user scopes with instancesof native resources 258, and installation scopes with instances ofnative resources 258; or any combination isolation scopes and nativeresources 258.

The installation root 214 can, in many embodiments, provide a modifiedview of the native resources 258. This modified view aggregatesindividual installation scopes 230 included within the installation root214 to provide a requesting application with instances of the nativeresources specific to the application. The installation root 214 can, insome embodiments, communicate directly with the user root 212 and thesystem root 216; while in other embodiments the installation root 214can communicate with other roots via installation scopes 230 within theinstallation root 214. Other embodiments include any of the abovedescribed installation root 214 configurations.

Installation scopes 230 are, in one embodiment, included in theinstallation root 214 and further configured to communicate with userscopes included in the user root 212. Other embodiments includeinstallation scopes that communicate with one system scope 256, morethan one system scope 256, or may not communicate with other scopes.Installation scopes 230 can, in one embodiment, create associations withan application 203, another installation scope 230, or both anapplication 203 and an installation scope. In one embodiment,installation scopes 230 are configured to present requestingapplications with instances of native resources 258 that are particularto a requesting application. In this embodiment, installation scopes 230are configured to represent a single application or in other embodimentsrepresent multiple applications, such that the representativeinstallation scope contains the native resources required by acorresponding application. One embodiment includes a first application202 represented by and associated with a first installation scope 244such that the first application 202 may access and manipulate the viewof native resources 258 included in the first installation scope 244;and a second application 204 represented by and associated with a secondinstallation scope 246 such that the second application 204 may accessand manipulate the view of native resources 258″ included in the secondinstallation scope 246. In this embodiment, the first installation scope244 and the second installation scope 246 may be further associated witha third installation scope 252 such that either or both of the firstinstallation scope 244 and the second installation scope 246 may accessand manipulate the view of native resources 258′″ included in the thirdinstallation scope 252. Another embodiment includes a third applicationrepresented by and associated with a fourth installation scope 248, suchthat the third application 206 may access and manipulate the view ofnative resources 258 included in the fourth installation scope 248.Still another exemplary embodiment could include a fourth application208 represented by and associated with a fifth installation scope 250such that the fourth application 208 may access and manipulate the viewof native resources 258 included in the fifth installation scope 250. Inthis embodiment, the fifth installation scope 250 may be furtherassociated with a sixth installation scope 254 such that the fourthapplication 208 may access and manipulate the view of native resources258 included in the sixth installation scope 254.

In one embodiment, a user root 212 is included. The user root 212further includes user scopes 232, 234, 236 where each user scopecommunicates with an installation scope in the installation root 214.Embodiments of the computing machine 200 include a user root 212 withuser profiles, where the user profiles store user-specific setting andconfiguration information that can be accessed by applications executingwithin a user session. Still other embodiments include a computingmachine 200 with more than one user root 212, where each included userroot 212 contains user-specific setting and configuration informationand where each user root 212 corresponds to a particular user. Otherembodiments do not include a user root 212, but rather include aninstallation root 214 that includes an installation scope dedicated tostoring instances of native resources that correspond to user-specifiedsettings and configurations. One embodiment includes a user root 212with multiple user scopes. In this embodiment, one user scope (notillustrated) can be dedicated to storing user-specified setting andconfiguration information that is specific to a particular application.For example, the user scope would be configured to store instances ofthe native resources that correspond to the user-specified settings forMicrosoft Word®. In this example, each time the Microsoft Word®application executes within that particular user session, the MicrosoftWord® configurations and settings specified by that user, can beavailable to the Microsoft Word® application.

User scopes, in one embodiment, are included within the user root 212.In one embodiment, the user scopes 232, 234, 236 each correspond to auser session 238, 240, 242. The user scopes 232, 234, 236 includeinstances of native resources 258 where each instance is representativeof the settings and configurations specific to a particular user session238, 240, 242. Other embodiments include user scopes 232, 234, 236 thatinclude sub-scopes. In this embodiment, the native resource viewpresented to an application executing in that scope is the aggregate ofthe modifications contained within each user-scope sub-scope. Sub-scopesare, in one embodiment, layered on top of each other, and in theaggregate view modifications to a resource in a higher sub-scopeoverride modifications to the same resource in lower layers. Otherembodiments may include user scopes 232, 234, 236 that contain nativeresource instances specific to a set of users. Still other embodimentsmay include user scopes 232, 234, 236 where the native resourcesinstances are defined by a system administrator, or by a pre-determinedgroup of users defined within the operating system 210. Anotherembodiment may include user scopes, where some user scopes include aninstance of the native resources that is specific to a particular usersession. In this embodiment, the user scope may persist and remainavailable for future login session, while other embodiments include auser scope that is destroyed when the user session ends. Nativeresources included within the user scopes can, in some embodiments, bealtered by applications executing within a corresponding user session;while in other embodiments, the native resource instances can be alteredby user input. One example of the use of user scopes within thecomputing machine 200, includes one with a first application 202executing within a first user session 238 that has a first user profileoutlining user-specific settings, configurations, and compositionsspecific to the first application 202. In this example, a first userscope 232 modifies a view of native resources according to the firstuser profile, and provides the first application 202 with access tothese user-specified native resources during a first user session 238.Another example of the use of user scopes within the computing machine200, includes one with a third application 206 and a fourth application208 executing within a third user session 242 that has a third userprofile outlining user-specific settings, configurations, andcompositions specific to the third application 206. In this example, athird user scope 236 modifies a view of native resources according tothe third user profile and provides the third application 206 and thefourth application 208 with access to these user-specified nativeresources during the third user session 242. Put another way, the userroot 212 alters the view of native resources for each individual user by“layering” a user-specific, modified view modification that is providedby a user isolation scope 232, 234, 236 “on top of” anapplication-specific, modified view that is provided by an installationroot 214, which is in turn “layered on top of” the system-wide view ofnative resources provided by the system root 216.

Still referring to FIG. 2B, user sessions 238, 240, 242 and applications202, 204, 206, 208 are included, in one embodiment, within the computingmachine 200. A user session 238, 240, 242 corresponds to a user suchthat when a user utilizes the computing machine 200, a user session iscreated and any user-input or user-output generated by the user isconfined to the user session. When, in this embodiment, applications areexecuted by a user, the application is executed within the user session.In some embodiments of the computing machine 200, multiple users may beable to access multiple user sessions. Still other embodiments mayprovide applications 202, 204, 206, 208 accessible by more than oneuser-session at a time.

One embodiment of the computing machine 200 includes an isolationenvironment 260. The isolation environment 260 includes both a user root212 and an installation root 214. Other embodiments may include anisolation environment 260 such as any of the above described isolationenvironments. In one embodiment of the computing machine 200, theisolation environment 260, although described in relation to multi-usercomputers supporting concurrent execution of application programs byvarious users, may also be used on single-user computers to addressapplication compatibility and sociability problems resulting fromsequential execution of application programs on the same computer systemby different users, and those problems resulting from installation andexecution of incompatible programs by the same user. In someembodiments, an installation scope or installation sub-scope may beassociated with an individual thread instead of an entire process,allowing isolation to be performed on a per-thread basis. In someembodiments, per-thread isolation may be used for Services and COM+servers.

Isolating applications within an installation scope requires, in oneembodiment, that an application is installed into a particularinstallation scope (described below in more detail,) and the applicationis launched into that particular installation scope. In embodimentswhere applications are installed into an installation scope, theinstalled applications continue to be associated with their respectiveinstallation scopes until settings associated with the installationscopes are altered. Other embodiments include applications that arelaunched into a particular installation scope, or more than oneinstallation scope, and as a result become associated with the one ormore installation scopes. Installation scopes, in many embodiments,provide associated applications with a unique view of native resourceswhen the associated applications are launched into a correspondinginstallation scope. In these embodiments, this unique view is specificto the operating requirements of each application. Applications may alsobe launched into the system scope 256, that is, they may be associatedwith no isolation scope. This allows for the selective execution ofoperating system 210 applications such as Internet Explorer, as well asthird party applications, within an isolation environment 260.

This ability to launch applications within an isolation scope regardlessof where the application is installed mitigates applicationcompatibility and sociability issues without requiring a separateinstallation of the application within the isolation scope. The abilityto selectively launch installed applications in different isolationscopes provides the ability to have applications which require helperapplications (such as Microsoft Word®, Notepad, etc.) to have thosehelper applications launched with the same rule sets. Further, theability to launch an application within multiple isolated environmentsallows for better integration between isolated applications and commonapplications.

Illustrated in FIG. 2C is a method 2003 for associating an applicationwith an installation scope. The method 2003 includes launching theprocess in a suspended state (step 2004), and retrieving the rulesassociated with the desired installation scope (step 2006). Anidentifier for the application and the retrieved application rules arestored in a memory element (step 2008) and the suspended application isresumed (step 2010). Subsequent calls to access native resources made bythe application are intercepted or hooked (step 2012) and the rulesassociated with the process identifier, if any, are used to virtualizeaccess to the requested resource (step 2014).

Still referring to FIG. 2C, and in more detail, an application islaunched in a suspended state (step 2004). In some embodiments, a customlauncher program is used to accomplish the task of launching theapplication in a suspended state. These embodiments may include alauncher specifically designed to launch an application into a selectedinstallation scope. Other embodiments of the method 2003 include alauncher that accepts as input a specification of the desiredinstallation scope, for example, by a command line option. In oneembodiment of the method 2003 the application launched into a suspendedstate is a software application, while in others the application can be:a process; software commands; a routine; or an executable program.

In one embodiment of the method 2003, the rules associated with thedesired installation scope are retrieved (step 2006). Some embodimentsretrieve the rules from a persistent storage element, such as a harddisk drive or other solid state memory element. Other embodimentsretrieve the rules from any one of the following locations: a relationaldatabase; a flat file database; a tree-structured database; a binarytree structure; a custom configured data structure; a temporary memorylocation; or any other type of persistent data structure. Still otherembodiments do not retrieve rules, but rather retrieve user-specifiedcommands from a temporary memory storage (not illustrated).

An application identifier and the retrieved rules are, in oneembodiment, stored in a memory element (step 2008). In one embodiment,where the application is a process, the retrieved rules and a process id(PID) are stored in memory. When a kernel mode driver is provided thatreceives operating system 210 messages concerning new process creation,another embodiment of the method 2003 can store the applicationidentifier and the rules in the context of the kernel mode driver. Inother embodiments, a file system filter driver, or mini-filter, isprovided to intercept native resource requests. In these embodiments,the PID and the retrieved rules may be stored in the filter. In otherembodiments still, all interception is performed by user-mode hookingand no application identifier is stored. In this embodiment, the rulesare loaded by the user-mode hooking apparatus during the applicationinitialization, and no other component needs to know the rules thatapply to the application identifier because rule association isperformed entirely within the application.

In one embodiment of the method 2003, the suspended process resumes(step 2010) and any subsequent calls made by the application to accessnative resources, are intercepted or hooked (step 2012). Embodimentsthat include rules use those rules associated with the applicationidentifier to virtualize access to the requested resources (step 2014).In some embodiments, a file system filter driver, or mini-filter,intercepts requests to access native resources and determines if theapplication identifier associated with the intercepted request has beenassociated with a set of rules. When, in one embodiment, the applicationidentifier is associated with a set of rules, those associated rules areused to virtualize the request made by the application to access nativeresources. When no rules are associated with the application identifier,the request to access native resources is passed through unmodified. Inother embodiments, a dynamically-linked library is loaded into thenewly-created application and the library loads the isolation rules. Instill other embodiments, both kernel mode techniques (hooking, filterdriver, mini-filter) and user-mode techniques are used to interceptcalls to access native resources. For embodiments in which a file systemfilter driver stores the rules, the library may load the rules from thefile system filter driver.

Embodiments of the method 2003 include applications that are “children”of applications associated with installation scopes that are furtherassociated with the installation scopes of their “parent” application.In these embodiments, this method 2003 is accomplished by a kernel modedriver notifying the file system filter driver when a child applicationis created. In these embodiments, the file system filter driverdetermines if the application identifier of the parent process isassociated with an installation scope. If so, the file system filterdriver stores an association between the application identifier for thenewly-created child application and the installation scope of the parentapplication. In other embodiments, the file system filter driver can becalled directly from the system without use of a kernel mode driver. Inother embodiments, in applications that are associated with installationscopes, operating system 210 functions that create new applications arehooked or intercepted. When a request to create a new process isreceived from such an application, the association between the new childapplication and the installation scope of the parent is stored.

Providing Instances of Native Resources

Illustrated in FIG. 3A is one embodiment of a method 401 of aggregatingthe resource views included in scopes into a virtual scope 262. Themethod 401 includes intercepting a request for an enumeration of anative resource, the request generated by a first application (step403). The system scope instance of the native resources is enumerated,and all the resources encountered during the enumeration are added to avirtualized native resource view (step 406). The native resources in thelast installation scope are enumerated (step 409), and an “enumeratedresource instance add and replace” subroutine is called (step 412). Adetermination is made as to whether or not additional installationscopes are included within the isolation environment (step 415). When itis determined that there are additional installation scopes in theisolation environment, the native resources in the next installationscope are enumerated (step 418) and an “enumerated resource instance addand replace” subroutine is called (step 421). The determination is againmade as to whether or not additional installation scopes are includedwithin the isolation environment (step 415). If there are no additionalinstallation scopes included within the isolation environment, aninstance of the native resources in the user scope are enumerated (step424), and an “enumerated resource instance add and replace” subroutineis called (step 427). A virtualized native resource view is thendelivered to the requesting application (step 430).

Further referring to FIG. 3A in more detail, in one embodiment of themethod 401, the method 401 is carried out by a driver. The driver, insome embodiments, can be any one of the following: a file system filterdriver, a mini-filter, a driver, or any other type of virtual objectabove to carry out the methods described herein. Other embodiments ofthe method 401 may include a method 401 carried out by an application, asoftware program, or other set of software commands. Throughout thisdescription it should be understood that whenever general reference ismade to “scope,” it is intended to also refer to sub-scopes, where thoseexist.

In one embodiment of the method 401, requests generated by anapplication executing on the computing machine 200, are intercepted by adriver (step 403). The requests are, in one embodiment, requests for anenumeration of a native resource. While in one embodiment of the method401 the request can be for a single native resource, in otherembodiments, the request can be for more than one native resource.

The method 401 enumerates the system scope instance of the nativeresource, and adds all encountered native resource instances to avirtualized native resource view included within the virtual scope 262(step 406). In one embodiment of the method 401, the driver enumeratesthe instance of the native resource included in the system scope 256.The enumerated resources, in this embodiment, are added to a virtualizednative resource view included in the virtual scope 262. When, in otherembodiments, the system root 216 includes more than one system scope,the method 401 calls an “enumerated resource instance add and replace”subroutine in lieu of adding the enumerated system scope instance of thenative resource. In this embodiment, the “enumerated resource instanceadd and replace,” subroutine cycles through the more than one systemscope and adds and replaces native resource instances within thevirtualized native resource view. Embodiments include a method 401 thatproceeds to enumerating the last installation scope instance of thenative resources (step 409) when no instances of the requested nativeresource are found within the system scope. Still other embodiments ofthe method 401 include enumerating only those native resources pertinentto the requested resource, while other embodiments may includeenumerating native resources corresponding only to the requested nativeresource, and still other embodiments may include enumerating allavailable native resources regardless of which native resource wasrequested.

Native resource instances in the last installation scope are, in oneembodiment of the method 401, enumerated (step 409). The lastinstallation scope, in this embodiment, is the installation scopelocated nearest to the system scope. Put another way, the lastinstallation scope is the installation scope on which a base applicationinstance is installed. This base application instance is an applicationinstance that is shared by the other applications and applicationinstances installed within the other installation scopes included in theinstallation root 214. In this embodiment of the method 401, subsequentinstallation scopes have applications installed thereon that referencethis base application. Other embodiments of the method 401 enumerate thenative resource instances in a first installation scope; while stillother embodiments enumerate the native resource instances in aninstallation scope included within the installation root 214.Enumeration of the native resource instance means retrieving allinstances of the native resource from a scope. Some embodiments of themethod 401 can retrieve, obtain, or get native resources from the lastinstallation scope.

In one embodiment of the method 401, an “enumerated resource instanceadd and replace” subroutine is called. An embodiment of the “enumeratedresource instance add and replace” subroutine 451 is illustrated in FIG.3B. This subroutine 451 cycles through multiple scopes to add thoseinstances of a native resource not yet included within the virtualizednative resource view into the virtualized view, and to replace thosenative resource instances within the virtualized view with newlydiscovered native resource instances. Other embodiments of the method401 may include the subroutine 451 within the main method 401, or mayinclude a portion of the subroutine 451 within the main method 401.

A determination is made as to whether or not there are additionalinstallation scopes within the installation root 214 (step 415). When adetermination is made that there are additional installation scopeswithin the installation root 214, user scope instances of the nativeresource are enumerated (step 424). Other embodiments of the method 401can account for more than one installation scope such that the method401 does not make a determination as to whether or not there areadditional installation scopes, but rather enumerates the installationscope native resource instances a pre-determined number of timescorresponding to the number of installation scopes included in theinstallation root 214. Still other embodiments of the method 401 includeenumerating the native resource instances in one of the installationscopes, and performing no further checks as to whether or not additionalinstallation scopes are included in the installation root 214.

In one embodiment of the method 401, when a determination is made thatthere are additional installation scopes, the instances of the nativeresource within the next installation scope are enumerated (step 418).The last installation scope refers to the installation scope next inline from the last installation scope. For example if the installationroot 214 included three installation scopes listed in order from one tothree, with the third installation scope being the closest to the systemscope, the third installation scope would be the last installationscope. In this example, the second installation scope would be the nextinstallation scope queried. This means that the native resourceinstances in the second installation scope would be the next set ofnative resource instances to be enumerated. Further referring to thisexample, the first installation scope would include the last set ofnative resource instances to be enumerated.

A call is made to the “enumerated resource instance add and replace”subroutine 451 (step 421) and the resources enumerated in the nextinstallation scope are either added to the virtualized native resourceview, or inserted into to the virtualized native resource view in placeof a native resource instance already included in the virtualized nativeresource view. Another determination is made, in one embodiment of themethod 401, as to whether or not there are additional installationscopes are included in the installation root 214 (step 415). In thisembodiment of the method 401, determinations are made as to whether ornot additional installation scopes are included in the installation root214 (step 415), instances of the native resource included in the nextinstallation scope are enumerated (step 418), and the “enumeratedresource instance add and replace” subroutine 451 is called (step 412),until all the installation scopes included in the installation root 214are cycled through. Other embodiments of the method 401 may only cyclethrough additional installation scopes when it is determined that thefirst installation scope does not have an instance of the requestednative resource (not illustrated). Still other embodiments of the method401 may cycle through only a portion of the installation scopesaccording to user input or system requirements.

If a determination is made that there are not additional installationscopes, then those instances of the native resource in the user scopeare enumerated (step 424). In this embodiment, a single user scope issearched for native resource instances. Other embodiments include acycle similar to that used for the installation scopes (step 415-step421) to cycle through multiple user scopes when the user root 212includes multiple user scopes. An enumeration of native resourceinstances in a user scope can, in one embodiment of the method 401,include enumerating a single native resource instance corresponding tothe requested native resource, or in other embodiments, can includeenumerating multiple native resource instances related to the requestednative resource.

Embodiments of the method 401 make a call to the “enumerated resourceinstance add and replace” subroutine 451 (step 427) to add enumeratednative resource instances identified in the user scope or replacealready existing native resource instances with the enumerated nativeresource instances identified in the user scope. Other embodimentsinclude a method 401 that incorporates the steps within the subroutine451 into the main method 401. Still other embodiments may return anynative resource instance found within the user scope to the requestingapplication. In this embodiment, a virtualized native resource viewwould not be shown to the application, but rather an instance of thenative resource within the user scope would be shown to the requestingapplication. Such an embodiment would operate the method 401 under thepresumption that those instances of the native resource included withinthe user scope, take precedence over those native resources retrievedfrom either installation scopes or the system scope.

A virtualized view of the native resource is delivered to the requestingapplication (step 430), in one embodiment of the method 401. Thisvirtualized view can in one embodiment include all found instance of thenative resource. Other embodiments return to the requesting applicationa single instance of the native resource found within the most seniorscope. In this embodiment, scope seniority is determined according to anorder of priority analogous to an ordering of a user scope, a firstinstallation scope, subsequent installation scopes, a last installationscopes, and a system scope; where the user scope has the most priorityand the system scope has the least priority. Other embodiments mayinclude an order of priority that is the reverse of the above describedorder of priority. Still other embodiments may include a user-defined orsystem-defined order of priority, or any other order of priority notanalogous to the above defined ordering. In one embodiment, an instanceof the native resource is returned to the requesting application that isfound in the scope with the least priority. Other embodiments return tothe requesting application a full aggregation of all the nativeresources included in each of the scopes where the aggregate nativeresource instance corresponds to the native resource instance includedin a pre-determined scope.

Illustrated in FIG. 3B is an embodiment of the “enumerated resourceinstance add and replace” subroutine 451. The method 451 makes adetermination as to whether or not the enumerated resource instance froma particular scope includes resources that are not already included inthe virtualized native resource view included in the virtual scope 262(step 440). When the determination is made that the enumerated resourceinstance is not included in the virtualized native resource view, thatenumerated resource instance is then added to the virtualized nativeresource view (step 443). When the determination is made that theenumerated resource instance is already included within the virtualizednative resource view (step 440), or when the enumerated native resourceinstance is added to the virtualized native resource view (step 443); adetermination is made to verify that the enumerated resource instanceincludes resource instances already included in the virtualized nativeresource view (step 446). If it is determined that the enumeratedresource instance does not include resource instances already includedwithin the virtualized native resource view, then the “enumeratedresource instance add and replace” subroutine is exited (step 452) andthe main method 401 resumes. If it is determined that the enumeratedresource instance does include resource instances already includedwithin the virtualized native resource view, then those resources in thevirtualized native resource view that are the same as the nativeresources identified in the enumeration of resources, are replaced withthe enumerated native resource instance (step 449). The “enumeratedresource instance add and replace” subroutine is then exited (step 452)and the main method 401 resumes.

In one embodiment, a conceptually similar method may be performed toenumerate an installation scope, or other scope that includes more thanone sub-scope. In this embodiment, the individual sub-scopes areenumerated, where in the aggregate resource view, resources from higherpriority sub-scopes replace the matching instances from lower prioritysub-scopes.

Further referring to FIG. 3B and in more detail, an enumerated nativeresource instance is passed to the subroutine 451 from the main method401 (step 412, step 421, step 427), and a determination is made as towhether or not the enumerated native resource instance is alreadyincluded within the virtualized native resource view (step 440). Inother words, in this embodiment when there is an instance of a nativeresource already included within the virtualized native resource viewthat is identified by a virtual name or other form of identificationthat is substantially similar to the virtual name or identifier given tothe enumerated native resource instance, a determination can be madethat an instance of the enumerated native resource instance alreadyexists within the virtualized native resource view. Other embodimentsmay include comparing virtual names, or other identifying criteriaassociated with the native resource instances included in thevirtualized native resource view with those virtual names or otheridentifying criteria associated with the enumerated native resourceinstance returned to the subroutine 451 from the main method 401. Stillother embodiments could include a search through the virtualized nativeresource view to identify native resources that are substantiallysimilar to the enumerated native resource instance.

When, in one embodiment, it is determined that the enumerated nativeresource is not already included in the virtualized native resourceview, the enumerated native resource instance is added to thevirtualized native resource view (step 443). In this embodiment, addingthe enumerated native resource instance to the virtualized nativeresource view can include naming the enumerated native resource instancea virtual name, or otherwise identifying the enumerated native resourceinstance via an identifier that signifies to a driver or other objectthat the type and configuration of the enumerated native resourceinstance. Other embodiments of the subroutine 451 add the enumeratednative resource to the virtualized native resource view regardless ofwhether or not an instance of the native resource is already included inthe virtualized resource view. In such an embodiment, either asubsequent application would filter out duplicate native resourceinstances, or the virtualized resource view would be configured todisplay only the relevant native resource instances to the requestingapplication. Still other embodiments may include a subroutine 451 thatdoes not add new resources to the virtualized native resource view.

When it is determined that the enumerated resource instance alreadyexists within the virtualized native resource view, a furtherdetermination is made as to whether or not the enumerated nativeresource instance includes resource instances that are already includedin the virtualized native resource view (step 446). In this embodiment,the further determination is made to verify that an instance of aresource substantially similar in type and/or having a substantiallysimilar identifier or virtual name. Other embodiments may not include asecond determination as to whether or not the enumerated resourceinstance is already included in the virtualized native resource view;but may proceed from a determination that the enumerated resourceinstance is already included within the virtualized native resource view(step 440) to replacing the resource within the virtualized nativeresource view with the newly enumerated native resource instance (step449).

In one embodiment, when an enumerated resource instance is determined toalready exist within the virtualized native resource view, that resourceis replaced by the newly enumerated native resource instance (step 449).Native resource instances, in this embodiment, that are already includedwithin the virtualized native resource view, have a lower priority thansubsequently added native resource instances. In other words, sincenative resource instances are added from scopes of lower priority, likethe system scope 256, before native instances are added from scope ofhigher priority, like user scopes; subsequently added native resourceinstances have more priority than already existing native resourceinstances. One example of this would be an instance of native resource Athat is a type A resource, where the instance of native resource A isretrieved from the system scope 256 and added to the virtualized nativeresource view. In this example, a subsequent instance of native resourceA is identified within a user scope. Those native resources within theuser scope are a higher priority than those in the system scope becausenative resources within the user scope indicate user-specified settingsthat are more desirable than a system native resource which isessentially a generic resource common amongst all user sessions. Furtherreferring to this example, the second instance of native resource A fromthe user scope is added to the virtualized native resource view, and thefirst instance of native resource A from the system scope is deletedfrom the virtualized native resource instance. Returning a nativeresource from the user scope rather than the system scope ensures thatsettings created by a user and associated with a user scope, can beavailable to that user the next time the user executes an application.In other words, replacing the lower priority native resource instancewith the higher priority native resource instance, in this example,preserves user settings. Another example could include a system scopeand an installation scope, where replacing the system scope instance ofthe native resource with the installation scope instance of the nativeresource preserves application settings and configurations so that thenext time the application is executed, the settings and configurationsare preserved. In other embodiments, the newly enumerated nativeresource instance is added to the virtualized native resource view, anda filter is later applied to remove the lower priority native resourceinstances. Still other embodiments include re-configuring an instance ofa native resource when subsequent and substantially similar nativeresource instances are enumerated. In this embodiment, the existingnative resource instance would be re-configured so as to resemble thenewly enumerated native resource instance. Other embodiments include asubroutine 451 that does not replace those resources in the virtualizednative resource view with those resources in the enumerated resourcelist when such common resources are identified. Still other embodimentsinclude a subroutine 451 that replaces only those resource instancesthat are marked with permissions that allow the resource to be replacedby a subsequent resource of higher or lower priority. Still otherembodiments include a subroutine 451 that replaces common resources whenthe enumerated resource is different from the virtualized nativeresource.

When, in some embodiments, the subroutine 451 determines that there arenot native resource instances included in the virtualized nativeresource view that correspond to the enumerated native resourceinstance, the subroutine exits (step 452). Other embodiments of thesubroutine 451 can include exiting the subroutine (step 452) and returnto the main method 401. Still other embodiments of the subroutine 451exit the subroutine (step 452) and the main method 401. In oneembodiment of the subroutine 451, the subroutine exits and does notreturn to the main method 401.

While FIG. 3A and FIG. 3B contemplate an embodiment of a method 401 andsubroutine 451 for aggregating native resource views, other embodimentsmay include a method 401 where the subroutine 451 is integrated into themethod 401. Still other embodiments may include a method 401 that isfurther segmented into additional subroutines.

Illustrated in FIG. 4 is one embodiment created during the aggregationof more than one scope and displayed to an application executing on thecomputing machine 200. Creation and display of the virtual scope 262further mitigates problems arising from application incompatibility andapplication non-sociability. Included within the virtual scope 262 is auser scope 282, a first installation scope 284A, a second installationscope 284B, a last installation scope 284N, and a system scope 286.Within each of the scopes is a set of native resources 258′, 258″,258′″, 258″″, 258′″″.

Further referring to FIG. 4 and in more detail, the virtual scope 262aggregates individual scopes that modify a native resource view 258.Aggregation of the modified resource views 258 further creates anaggregate view of the available native resources which is displayed toapplications. The virtual scope 262 illustrated in this embodimentcombines the user scope 282 with the system scope 286 and theinstallation scope(s) 284A-284N. Other embodiments can combineadditional scopes (not illustrated) with the user scope 286, theinstallation scopes 284A-284N, and the system scope 286. Still otherembodiments can include any combination of a user scope 282, aninstallation scope 284A-284N, and a system scope 286, includingcombinations where the virtual scope 262 includes a single type ofscope, or one or more types of scope. Other embodiments include avirtual scope 262 that enumerates and aggregates instances of nativeresources from the user scope 282 down to the system scope 286. In thisembodiment those native resource instances in the system scope 286 wouldhave a higher priority than native resource instances in theinstallation scopes 284A-284N, and native resource instances in the userscope 282. Other embodiments may forgo creating a virtual scope 262 andperform a substantially instantaneous retrieval of a requested nativeresource in response to an application request, and using a series ofqueries and responses rather than enumerating and compiling theresources into a virtualized native resource view included in a virtualscope 262.

In one embodiment, each included scope has a group of modified nativeresource instances 258. When an application executing on the computingmachine 200 requests a native resource, the application is presentedwith a virtual scope substantially similar to the virtual scopeillustrated in FIG. 4. In this scope, the user-specific native resources258′ are combined with the application specific native resource views258″-258″″ and the system specific native resource views 258′″″ tocreate a single virtualized native resource view of the nativeresources. In this embodiment, a user-specified resource view 258′ takesprecedence over an application specific resource view 258″-258″″, whilean application specific resource view 258″-258″″ takes precedence over asystem specific resource view 258′″″. To take precedence over the nativeresource views 258 in a junior scope, implies that if there were asingle setting common to both the native resource views of a seniorscope and the native resource views of a junior scope, the settingassociated with the senior scope can be included in the virtual scope262. The concept of a senior and junior scope translates into anembodiment where there are multiple installation scopes 230 that can beranked in order from first to last based on each scope's status withrelation to the preceding and succeeding scopes. For example, in thisembodiment if there were three scopes, then the last scope would bejunior to the second scope, the second scope would be junior to thefirst scope, and the first scope would be senior to both the secondscope and the third scope. In an embodiment of the virtual scope 262that includes senior and junior scopes, a modification to a nativeresource in a junior scope is available to all those senior scopesassociated with that junior scope; a modification to a resource in asenior scope, however, is not be available to all those junior scopesassociated with the senior scope. These concepts can be extended toembodiments that utilize sub-scopes, such that the modifications to thenative resource view included in a user sub-scope are common to allapplications associated with the applicable installation sub-scopeexecuting on behalf of a user, or group of users, associated with a usersub-scope.

If an application attempts to open an existing instance of a nativeresource with no intent to modify that resource, the specific instancethat is returned to the application is the one that is found in thevirtual scope 262, or equivalently the instance that would appear in thevirtualized enumeration of the parent of the requested resource. Fromthe point of view of the isolation environment 260, the application issaid to be requesting to open a “virtual resource”, and the particularinstance of native resource used to satisfy that request is said to bethe “literal resource” corresponding to the requested resource.

If an application executing on behalf of a user attempts to open aresource and indicates that it is doing so with the intent to modifythat resource, that application instance is normally given a privatecopy of that resource to modify, as resources in the installation scopeand system scope are common to applications executing on behalf of otherusers. Typically a user-scope copy of the resource is made, unless theuser-scope instance already exists. The definition of the aggregate viewprovided by a virtual scope means that the act of copying aninstallation-scope or system-scope resource to a user scope does notchange the aggregate view provided by the virtual scope 262 for the userand application in question, nor for any other user, nor for any otherapplication instance. Subsequent modifications to the copied resource bythe application instance executing on behalf of the user do not affectthe aggregate view of any other application instance that does not sharethe same user scope. In other words, those modifications do not changethe aggregate view of native resources for other users, or forapplication instances not associated with the same installation scope.

A method for returning an instance of a native resource to a requestingapplication is illustrated in FIG. 5. This embodiment includes a method351 that substantially instantaneously responds to a request for anative resource generated by an application executing in a user sessionafter the request is intercepted (step 353). Upon interception of thenative resource request (step 353), a search is performed within thefirst installation scope for an instance of a native resourcecorresponding to the requested native resource (step 356). Adetermination is made as to whether or not a corresponding instance of anative resource was found (step 359), and if the resource was found, aninstance of the found native resource is retrieved from the firstinstallation scope (step 362). When a native resource is not found, thena search is performed for an association between the first installationscope and a second installation scope (step 365). A determination ismade as to whether or not an association between the first installationscope and the second installation scope was found (step 368), and if anassociation was not found, then a search is performed within the systemscope (step 383) for an instance of a native resource corresponding tothe requested native resource. When an association is found, then asearch is performed within the second installation scope for an instanceof a native resource corresponding to the native resource requested bythe application (step 371). A determination is made as to whether or notan instance of a native resource corresponding to the requested nativeresource was found within the second installation scope (step 374), andif no corresponding resource was found, a search is performed within thesystem scope (step 383) for an instance of a native resourcecorresponding to the requested native resource. If an instance of acorresponding native resource is found within the second installationscope, then the instance of the native resource corresponding to therequested native resource is retrieved from the second installationscope (step 377). When a corresponding instance of a native resource isretrieved from either of the first installation scope, or an associatedsecond installation scope, the retrieved resource instance is includedwithin the response sent to the request made by the application for anative resource (step 380).

Further referring to FIG. 5 and in more detail, in the illustratedembodiment, the method 351 includes intercepting a request made by anapplication executing in a user session (step 353). In this embodiment,the request is made by a single application for a native resource. Otherembodiments include a request made by one or more applications for oneor more native resources. Further embodiments include an operatingsystem 210 with a filter driver, driver, or other virtual objectconfigured to intercept the application requests and implement themethod 351.

In one embodiment, a search is performed in a first installation scopefor an instance of a native resource corresponding to the nativeresource requested by the application (step 356). A first installationscope is the installation scope with the highest priority over all otherinstallation scopes included in the isolation environment 260. Forexample, if three installation scopes were included in the isolationenvironment 260, then the first installation scope would be the scopewith the highest priority over the other two installation scopes. Thelast installation scope, in this example, would be the installationscope with a lower priority than each of the other two installationscopes. Priority, in this example, is determinative of whether a nativeresource included in a scope is shown to a requesting application overresources included in other scopes. In this example, a resource includedin the first installation scope can take priority over a resource ineither of the second installation scope or the last installation scope,meaning that the requesting application is shown an instance of thenative resource included in the first installation scope rather than aninstance of the native resource included in the second installationscope, or the last installation scope.

A determination is made, in one embodiment, as to whether or not acorresponding native resource was found in the first installation scope(step 359). If a corresponding native resource is found, then aninstance of this found resource is retrieved from the first installationscope (step 362). This instance of the native resource can, in someembodiments, be returned substantially immediately to the requestingapplication, or a further search may be done to find additionalinstances of the requested resource.

In one embodiment, if no corresponding instance of a native resource isfound in the first installation scope, then a search is done for anassociation between the first installation scope and a secondinstallation scope (365). Embodiments include searching for anassociation indicating that the first installation scope is associatedwith a second installation scope with respect to the applications eachinstallation scope isolates. In one embodiment, a first applicationisolated within a first installation scope may interact with a secondapplication isolated in a second installation scope. Rather than combineeach application in a single installation scope, each applicationexecutes within its respective installation scope and the applicationsinteract per associations established between the installation scopes.Association between the installation scopes, may in some embodimentscause the installation scopes to interact together within the isolationenvironment 260, while other embodiments may cause the installationscopes to interact together within the isolation environment 260 on acase by case basis.

A determination is made as to whether or not an association between thefirst installation scope and the second installation scope is found(step 368), and in one embodiment, the method then searches within thesecond installation scope for a corresponding native resource (step371). While the embodiment illustrated in FIG. 5 depicts a search for anassociation between a first installation scope and a second installationscope, other embodiments may include a search for additionalassociations between one or more installation scopes, for example: anassociation between a second installation scope and a third installationscope, an association between a third installation scope and a fourthinstallation scope, and an association between an “n” installation scopeand a “n+1” installation scope where n is any number greater than two.If no association is found between the first installation scope and anadditional installation scope, then the method identifies a candidateresource in the system scope and searches within the system scope toverify the existence of the candidate resource (step 383).

In one embodiment, a determination is made as to whether or not aninstance of a corresponding native resource is present within the secondinstallation scope (step 374). When in one embodiment no resourceinstance is found, the method 351 then searches within the system scopefor a corresponding instance of the requested native resource (step386). In one embodiment, a found instance of the native resource isretrieved from the second installation scope (step 377), and this nativeresource instance is sent to the requesting application when a responseto the application request is sent to the application (step 380).

Another embodiment includes a computing machine 200 configured toassociate any application instance with any installation scope,regardless of whether the application was installed into thatapplication isolation scope, another application isolation scope or noapplication isolation scope. Applications which were not installed intoa particular application scope can be executed on behalf of a user inthe context of an installation scope and the corresponding user scope,because their native resources are available to them via the aggregatedvirtual scope 262 formed by the user scope, installation scopes and thesystem scope. Where it is desired to run an application in isolation,this computing machine 200 provides the ability for applicationsinstalled directly into the system scope to be run within an isolationenvironment 260 without requiring a separate installation of theapplication within the isolation environment 260. This also provides theability for applications installed directly into the system scope 256 tobe used as helper applications in the context of any scope.

Each application instance, including all of the processes that make upthe executing application, is associated with either zero or oneinstallation scopes, and by extension exactly zero or one correspondinguser scopes. This association is used by the rules engine whendetermining which rule, if any, to apply to a resource request. Theassociation does not have to be to the installation scope that theapplication was installed into, if any. Many applications that areinstalled into a scope does not function correctly when running in adifferent scope or no scope because they cannot find necessary nativeresources. However, because a virtual scope 262 is an aggregation ofresource views including the system scope, an application installed inthe system scope can generally function correctly inside anyinstallation scope. This means that helper programs, as well asout-of-process COM servers, can be invoked and executed by anapplication executing on behalf of a user in a particular scope.

In some embodiments, applications that are installed in the system scopeare executed in a scope for the purpose of identifying what changes aremade to the computer's files and configuration settings as a result ofthis execution. As all affected files and configuration settings areisolated in the user scope, these files and configuration settings areeasily identifiable. In some of these embodiments, this is used in orderto report on the changes made to the files and configuration settings bythe application. In some embodiments, the files and configurationsettings are deleted at the end of the application execution, whicheffectively ensures that no changes to the computer's files andconfiguration setting are stored as a result of application execution.In still other embodiments, the files and configuration settings areselectively deleted or not deleted at the end of the applicationexecution, which effectively ensures that only some changes to thecomputer's files and configuration setting are stored as a result ofapplication execution.

Virtualization Mechanism Overview

Illustrated in FIG. 6A is an embodiment for virtualizing access tonative resources in an execution mode. An access mode is distinguishablefrom an installation mode as described in more detail below. In briefoverview, a request to access a native resource is intercepted orreceived (step 502). The request identifies the native resource to whichaccess is sought. The applicable rule regarding how to treat thereceived access request is determined (step 504), and a furtherdetermination is made as to what action should be taken (step 505). Ifthe rule indicates the request should be ignored; then the literalresource name is set equal to the virtual resource name (step 507), theaccess request is passed without modification to the system root (step506), and the result returned to the requester (step 510). If the ruleindicates that the access request should be either redirected orisolated, the literal instance of the resource that satisfies therequest is identified (step 508), a modified or replacement request forthe literal resource is passed to the system layer (step 506) and theresult is returned to the requestor (step 510).

Still referring to FIG. 6A, and in more detail, a request identifying anative resource is intercepted or received (step 502). In someembodiments, requests for native resources are intercepted by “hooking”functions provided by the operating system 210 for applications to makenative resource requests. In one embodiment, interception using a“hooking” function is implemented via a dynamically-linked library (DLL)that gets loaded into the address space of new processes created by theoperating system 210, and which performs hooking during itsinitialization routine. Loading a DLL into each process is achieved insome embodiments using a facility provided by the operating system 210;or in other embodiments by modifying a list of DLLs to import includedin the executable image, where the list of DLLs are either in the diskfile, or in memory as the executable image for the process is loadedfrom disk. Still other embodiments perform “hooking” functions using aserver, a driver, or a daemon. In other embodiments, executable images,including shared libraries and executable files, provided by theoperating system 210 may be modified or patched in order to providefunction hooks or to directly embody the logic of this invention. Forspecific embodiments in which the operating system 210 is a member ofthe Microsoft WINDOWS family of operating systems, interception may beperformed by a kernel mode driver hooking the System Service DispatchTable. In still other embodiments, the operating system 210 may providea facility allowing third parties to hook functions that request accessto native resources. In some of these embodiments, the operating system210 may provide this facility via an application programming interface(API) or a debug facility.

In other embodiments, the native resource request is intercepted by afilter in the driver stack or handler stack associated with the nativeresource. For example, some members of the family of Microsoft WINDOWSoperating systems provide the capability to plug a third-party filterdriver or mini-filter into the file system driver stack and a filesystem filter driver or mini-filter may be used to provide the isolationfunctions described below. In still other embodiments the inventioncomprises a file system implementation that directly incorporates thelogic of this invention. Alternatively, the operating system 210 may berewritten to directly provide the functions described below. In someembodiments, a combination of some or all of the methods listed above tointercept or receive requests for resources may be simultaneouslyemployed.

In many embodiments, only requests to open an existing native resourceor create a new native resource are hooked or intercepted. In theseembodiments, the initial access to a native resource is the access thatcauses the resource to be virtualized. After the initial access, therequesting application program is able to communicate with the operatingsystem 210 concerning the virtualized resource using a handle or pointeror other identifier provided by the operating system 210 that directlyidentifies the literal resource. In other embodiments, other types ofrequests to operate on a virtualized native resource are also hooked orintercepted. In some of these embodiments, requests by the applicationto open or create virtual resources return virtual handles that do notdirectly identify the literal resource, and the isolation environment260 is responsible for translating subsequent requests against virtualhandles to the corresponding literal resource. In some of thoseembodiments, additional virtualization operations can be deferred untilproven necessary. For example, the operation of providing a privatemodifiable copy of a resource to an installation scope can be deferreduntil a request to change the resource is made, rather than when theresource is opened in a mode that allows subsequent modification.

In some embodiments, once the native resource request is intercepted orreceived, the applicable rule determining how to treat the particularrequest is determined (step 504). The applicable rule may, in someembodiments, be determined by reference to a rules engine, a database ofrules, or a flat file containing rules organized using an appropriatedata structure such as a list or a tree structure. In other embodiments,rules are accorded a priority that determines which rule is regarded asthe applicable rule when two or more rules apply. Rule priority, in manyembodiments, is included in the rules themselves or, in otherembodiments, rule priority may be embedded in the data structure used tostore the rules, for example, rule priority may be indicated by a rule'sposition in a tree structure. The determined rule in these embodiments,may include additional information regarding how to process thevirtualized resource request such as, for example, to which literalresource to redirect the request. In a specific embodiment a rule is atriple comprising a filter field, an action field, and data field. Inthis embodiment, the filter field includes the filter used to matchreceived native resource requests to determine if the rule is valid forthe requested resource name.

In one embodiment, a determination is made as to what action should beperformed (step 505). Some embodiments of the method 503 encapsulateaction information within the retrieved rule information. Exemplaryactions include: “ignore;” “redirect;” or “isolate”. Further embodimentsinclude a data field that include additional information concerning theaction to be taken when the rule is valid, including the function to beused when the rule is valid. Still other embodiments of the method 503include a determination as to which action should be performed (step505), where the action instruction is generated by user-input.

In many embodiments, a rule action of “ignore” means the requestdirectly operates on the requested native resource in the system scope.That is, the name of the literal resource is made to equal the virtualname (step 507), and the request is passed unaltered to the system root216 (step 506) and the request is fulfilled as if no isolationenvironment 260 exists. In this case, the isolation environment 260 issaid to have a “hole”, or the request may be referred to as a “passthrough” request.

If the rule action, in some embodiments, indicates that the nativeresource request should be redirected or isolated, then the literalresource that satisfies the request is identified (step 508). A ruleaction of “redirect” means in many embodiments, that the native resourcerequest directly operates on a system-scope native resource, albeit adifferent resource than specified in the request. The literal resourceis identified by applying a mapping function specified in, or impliedby, the data field of the determined rule to the name of the requestednative resource. In the most general case the literal native resourcemay be located anywhere in the system scope 256. As a simple example,the rule {prefix_match (“c:\temp\”, resource name), REDIRECT,replace_prefix (“c:\temp\”, “d:\wutemp\”, resource name)} can redirect arequested access to the file c:\temp\examples\d1.txt to the literal filed:\wutemp\examples\d1.txt. The mapping function included in the datafield of the rule and the matching function may be further generalizedto support complex behaviors by, for example, using regular expressions.Some embodiments may provide the ability to specify mapping functionsthat locate the literal resource within the user isolation scope or asub-scope applicable to the application executing on behalf of the user,or the installation scope or a sub-scope applicable to the application.Further embodiments may provide the ability to specify mapping functionsthat locate the literal resource within an installation scope applicableto a different application in order to provide a controlled form ofinteraction between isolated applications. In some particularembodiments, the “redirect” action can be configured to provide behaviorequivalent to the “ignore” rule action. In these embodiments, theliteral resource is exactly the requested native resource. When thiscondition is configured, the isolation environment 260 may be said tohave a “hole,” or the request may be referred to as a “pass through”request.

A rule action of “isolate” means that the request operates on a literalresource that is identified using the appropriate user scope andinstallation scope. That is, the identifier for the literal resource isdetermined by modifying the identifier for the requested native resourceusing the user scope, the installation scope, both scopes, or neitherscope. The particular literal resource identified depends on the type ofaccess requested and whether instances of the requested native resourcealready exist in the applicable user scope, the applicable installationscope and the system scope 256.

FIG. 6B depicts one embodiment of a process 508 that includes the stepstaken to identify the literal resource (step 506 in FIG. 6A) when arequest to open a native resource is received that indicates theresource is being opened with the intention of modifying it. Briefly, adetermination is made whether the user-scope instance, that is, aninstance that exists in an applicable user scope or user sub-scope, ofthe requested native resource exists (step 554). If so, the user-scopeinstance is identified as the literal resource for the request (step506), and that instance is opened and returned to the requestor. If theuser-scope instance does not exist, a determination whether the firstinstallation-scoped instance of the requested native resource exists ismade (step 556). If the first installation-scope instance exists, it isidentified as the “candidate” resource instance (step 569), andpermission data associated with the candidate instance is checked todetermine if modification of that instance is allowed (step 562). If nofirst installation-scope instance exists, then a determination whetherthere exists an association between the first installation scope and asecond installation scope is made (step 557). If such an associationexists between the first installation scope and a second installationscope exists, then a determination whether the second installation-scopeinstance of the requested native resource exists is made (step 559). Ifthe second installation-scope instance exists, it is identified as the“candidate” resource instance (step 569). If an association between thefirst installation scope and a second installation scope does not exist,or if an association does exist but no second installation-scopeinstance exists; then a determination is made whether the system-scopeinstance of the requested native resource exists (step 558). If asystem-scope instance does not exist, an error condition is returned tothe requestor indicating that the requested virtualized resource doesnot exist in the virtual scope (step 560). However, if the system-scopeinstance exists, the instance is identified as the candidate resourceinstance (step 569), and permission data associated with the candidateinstance is checked to determine if modification of that instance isallowed (step 562). If not, an error condition is returned to therequester (step 564) indicating that modification of the virtualizedresource is not allowed. If the permission data indicates that thecandidate resource may be modified, a user-scope copy of the candidateinstance of the native resource is made (step 570), the user-scopeinstance is identified as the literal instance for the request (step506), and is opened and returned to the requester.

Still referring to FIG. 6B, and in more detail, in one embodiment of theprocess 508, a determination is made whether the user-scope resourceexists, or in other words, whether the requested resource exists in theapplicable user scope or sub-scope (step 554). In some embodiments, theapplicable user scope or sub-scope is the scope associated with the usersession executing the application that made the request. The user scopeor a sub-scope, in an embodiment where the requested resource is a filefrom the file system, may be a directory under which all files thatexist in the user scope are stored. In some of these embodiments, thedirectory tree structure under the user scope directory reflects thepath of the requested resource. For example, if the requested file isc:\temp\test.txt and the user scope directory is d:\user1\app1\, thenthe path to the user-scoped literal file may bed:\user1\app1\c\temp\test.txt. In other embodiments, the path to theuser-scope literal file may be defined in a native naming convention.For example, the path to the user-scope literal file may bed:\user1\app1\device\harddisk1\temp\test.txt. In still otherembodiments, the user-scope files may all be stored in a singledirectory with names chosen to be unique and a database may be used tostore the mapping between the requested file name and the name of thecorresponding literal file stored in the directory. In still otherembodiments, the contents of the literal files may be stored in adatabase. In still other embodiments, the native file system providesthe facility for a single file to contain multiple independent named“streams”, and the contents of the user-scope files are stored asadditional streams of the associated files in the system scope 256.Alternatively, the literal files may be stored in a custom file systemthat may be designed to optimize disk usage or other criteria ofinterest.

If the user-scope resource instance does not exist, then a determinationis made whether the first installation-scope resource exists, or inother words whether the requested resource exists in the firstinstallation scope (step 556). In one embodiment, the methods describedabove are used to make this determination. For example, if the requestedfile is c:\temp\test.txt and the first installation scope directory ise:\app1\, then the path to the first installation-scope file may bee:\app1\c\temp\test.txt. As above, other embodiments may allow the pathto the first installation-scope file to be stored in a native namingconvention. The embodiments described above may also apply to the firstinstallation scope.

If the first installation-scope resource does not exist, then adetermination is made whether there exists an association between thefirst installation scope and a second installation scope (step 557). Inmany embodiments, multiple installation scopes may exist within theisolation environment 260, meaning that a first installation scope maybe associated with one or more additional installation scopes such thatimages of these additional installation scopes are included within theisolation environment 260 associated with the first installation scope.While FIG. 6B illustrates a process 508 that only checks for anassociation with a second installation scope, other embodiments of theprocess 508 may include checks for one or more additional installationscopes. In this embodiment, each additional installation scope would beanalyzed to determine if that installation scope contains an instance ofthe requested resource (analogous to step 559), and when thedetermination is true, the found resource would be identified as acandidate resource (step 569).

If an association between the first installation scope and a secondinstallation scope does exist, then a determination is made as towhether or not the second installation scope contains an instance of therequested resource (step 559). In one embodiment, the methods describedabove may be used to make this determination. For example, if therequested file is c:\temp\test.txt and the second installation scopedirectory is e:\app1\, then the path to the second installation-scopefile may be e:\app1\c\temp\test.txt. As above, other embodiments mayallow the path to the second installation-scope file to be stored in anative naming convention. The embodiments described above may also applyto the second installation scope.

If either the second installation-scope resource does not exist, or anassociation between the first installation scope and a secondinstallation scope does not exist; then a determination is made whetherthe system-scope resource exists, or in other words, whether therequested resource exists in the system scope (step 558). For example,if the requested file is c:\temp\test.txt then the path to thesystem-scope file is c:\temp\test.txt. If the requested resource doesnot exist in the system scope, an indication that the requested resourcedoes not exist in the virtual scope is returned to the requester (step560).

Whether the candidate resource instance for the requested resource islocated in one of the installation scopes, or in the system scope, adetermination is made whether modification of the candidate resourceinstance is allowed (step 562). For example, the candidate nativeresource instance may have associated native permission data indicatingthat modification of the candidate instance is not allowed by that usersession. Further, the rules engine may include configuration settingsinstructing the isolation environment 260 to obey or override the nativepermission data for virtualized copies of resources. In someembodiments, the rules may specify for some virtual resources the scopein which modifications are to occur, for example the system scope, aninstallation scope or a sub-scope, or the user scope or a sub-scope. Insome embodiments, the rules engine may specify configuration settingsthat apply to subsets of the virtualized native resources based onhierarchy or on type of resource accessed. In some of these embodiments,the configuration settings may be specific to each virtualized nativeresource. In another example, the rules engine may include configurationdata that prohibits or allows modification of certain classes of files,such as executable code, MIME types, or file types as defined by theoperating system 210.

If the determination is made that the permissions do not allowmodification of the candidate resource instance, then an error conditionis returned to the requester indicating that write access to the virtualresource is not allowed (step 564). If the determination is made thatthe permissions do allow the candidate resource instance to be modified,then the candidate instance is copied to the appropriate user scope orsub-scope (step 570). For embodiments in which the logical hierarchystructure of the requested native resource is maintained in the variousscopes, copying the candidate instance of the resource to the user scope(step 570) may require the creation in the user scope of hierarchyplaceholders. A hierarchy placeholder is a node that is placed in thehierarchy to correctly locate the copied resource in a scope. Ahierarchy placeholder stores no data, is identified as a placeholdernode, and “does not exist” in the sense that it cannot be the literalresource returned to a requestor. In some embodiments, theidentification of a node as a placeholder node is made by recording thefact in metadata attached to the node, or to the parent of the node, orto some other related entity in the system layer. In other embodiments,a separate repository of placeholder node names is maintained.

In some embodiments, the rules may specify that modifications toparticular resources may be made at a particular scope, such as theinstallation scope. In those cases the copy operation (step 570) isexpanded to determine whether modification to the candidate resourceinstance is allowed at the scope or sub-scope in which it is found. Ifnot, the candidate resource instance is copied to the scope or sub-scopein which modification is allowed, which may not be the user scope, andthe new copy is identified as the literal resource instance (step 506).If so, the candidate resource instance is identified as the literalinstance (step 506), and is opened and the result returned to therequestor (step 510).

Referring back to FIG. 6A, the literal resource instance, whetherlocated within the user scope (step 554) or created when copied into theuser scope (step 570); is opened (step 506) and returned to therequester (step 510). In some embodiments, opening the resource instanceand returning the instance to the requesting application is accomplishedby issuing an “open” command to the operating system 210 and returningto the requesting application the response from the operating system 210to the “open” command.

If an application executing on behalf of a user deletes a nativeresource, the aggregated view of native resources presented to thatapplication as the virtual scope 262 reflects that deletion. In oneembodiment, a request to delete a resource is a request for a specialtype of modification, albeit one that modifies the resource by removingits existence entirely. Conceptually a request to delete a resourceproceeds in a similar manner to that outlined in FIG. 6A, including thedetermination of the literal resource as outlined in FIG. 6B. In anembodiment that supports a deletion operation, however, identifying aliteral resource instance (step 506) operates differently for isolatedresources and for redirected or ignored resources. When the action is“redirect” or “ignore,” the literal resource is deleted from the systemscope. When the action is “isolate,” the literal resource is “virtually”deleted, or in other words the fact that it has been deleted is recordedin the user scope. A deleted node contains no data, is identified asdeleted, and it and all of its descendants “do not exist”. In otherwords, if it is the resource or the ancestor of a resource that wouldotherwise satisfy a resource request a “resource not found” error isreturned to the requestor. Outlined below are further details regardingthis process. In some embodiments, the identification of a node as adeleted node is made by recording the fact in metadata attached to thenode, or to the parent of the node, or to some other related entity inthe system root 216. In other embodiments, a separate repository ofdeleted node names is maintained, for example, in a separate sub-scope.

Installation of an Application into an Installation Scope

In many embodiments, an installation scope as described above is thescope in which associated instances of an application share resourcesindependently of other user sessions, or equivalently on behalf of allpossible user sessions, including the resources that those applicationinstances create. Embodiments can include a main class of theseresources that is created when an application gets installed onto theoperating system 210. Some embodiments include a computer 200 where twoincompatible applications do not have permission to be installedthereon. In this embodiment, the problem of incompatibility between twodifferent applications is solved by installing at least one of theapplications into an isolation environment 260. To accomplishinstallation of an application into an isolation environment 260, anembodiment of an installation method allows an installation scope, or anapplication instance associated with an installation scope to operate inan “install mode” such that the installation scope or applicationinstance can support installation of an application. In this embodiment,the “install mode” utilizes the installation program for a chosenapplication, and associates this installation program with aninstallation scope under the presumption that the installation programshould execute on behalf of all user sessions. The installation scope,in this embodiment, acts for the application instance as if theinstallation scope were a user scope for “all users” even though no userscope is active for that application instance.

Illustrated in FIG. 6C are is an embodiment of a method 508 operating ininstall mode, and an method 508 configured to identify a literalresource when a request to open a native resource is received thatindicates the resource is being opened with the intention of modifyingit. A determination is first made as to whether or not the resourceinstance exists within the first installation scope (step 524). If noresource instance exists within the first installation scope, then adetermination is made as to whether or not there is an associationbetween the first installation scope and a second installation scope(step 526). If there is no association between the first installationscope and a second installation scope, then a determination is made asto whether or not an instance of the resource exists within the systemscope (step 530). If there is an association between the firstinstallation scope and a second installation scope, then a determinationis made as to whether or not an instance of the resource exists withinthe second installation scope (step 528). If a determination is madethat an instance of the resource exists within the second installationscope, then the literal instance is identified as the instance foundwithin the second installation scope (step 531). If a determination ismade that an instance of the resource does not exist within the secondinstallation scope, then a determination is made as to whether or not aninstance of the requested resource exists within the system scope (step530). If no instance of the resource exists within the system scope,then an error of “Not_Found” is returned to the requesting application(step 532). If, however, an instance of the requested resource is foundwithin the system scope, then the system scope instance of the requestedresource is identified as the candidate resource (step 534). Adetermination is then made as to whether or not the permissionsassociated with the identified resource allow the identified resourceinstance to be modified (step 536). If the permissions do not allow fora modification of the identified instance of the resource, then an errorof “Permission Denied” is returned to the requesting application (step538). When, however, the permissions do allow for a modification of theidentified instance of the resource, then the candidate resource iscopied to the first installation scope (step 540), and the literalresource is the instance of the resource within the first installationscope (step 542). When a determination is made that an instance of theresource exists within the first installation scope (step 524), then theliteral resource is the instance of the resource within the firstinstallation scope (step 542).

Further referring to FIG. 6C in more detail, in one embodiment of themethod 508, no user-scope is active and so a determination is first madewhether there exists a first installation-scope instance of therequested native resource exists (step 524). If the firstinstallation-scope instance exists, it is identified as the literalresource instance (step 542). If no first installation-scope instanceexists, a determination is made as to whether or not there exists anassociation between the first installation scope and a secondinstallation scope (step 526). When it is determined that there existsan association, a further determination is made as to whether a secondinstallation-scope instance exists (step 528). In other embodiments ofthe method 508, more than two installation scopes are searched for aninstance of the resource, and determinations are made as to whether ornot there are associations between more than two installation scopes.

In one embodiment of the method 508, when no association is foundbetween the first installation scope and additional installation scopes,a determination is made as to whether or not an instance of the resourceexists within the system scope (step 530). If an instance of theresource does exist within the second installation scope, then thatfound resource is identified as the literal resource (step 531). Otherembodiments of the method 508 may copy the identified resource instanceto the first installation scope (step 540), and identify the copiedinstance as the literal resource.

In one embodiment of the method 508, when a determination is made that aresource identified in the system scope as the candidate resource (step534) has permission to be modified (step 536), that resource is copiedto the first installation scope (step 540) and identified as the literalresource (step 542). In some embodiments of the method 508, thecandidate file is copied to a location defined by the rules engine. Forexample, a rule may specify that the file is copied to an applicationisolation scope. In other embodiments the rules may specify a particularapplication isolation sub-scope or user isolation sub-scope to which thefile should be copied. Any ancestors of the requested file that do notappear in the isolation scope to which the file is copied are created asplaceholders in the isolation scope in order to correctly locate thecopied instance in the hierarchy.

Illustrated in FIG. 6D is an embodiment of a method 596 that operates ininstall mode such that the method 596 is configured to identify theliteral resource when a request to create a native resource is received.Briefly, as no user-scope is active, a determination is first madewhether the first installation-scope instance of the requested nativeresource exists (step 584). If the first installation-scope instanceexists, an error condition may be returned to the requester indicatingthat the resource cannot be created because it already exists (step590). If no first installation-scope instance exists, a determination ismade as to whether or not an association exists between the firstinstallation scope and the second installation scope (step 586). Ifthere is an association between the first installation scope and thesecond installation scope, then a determination is made as to whether ornot the system-scoped instance of the requested native resource exists(step 588). If an instance of the resource exists within the secondinstallation scope, then an error condition may be returned to therequester indicating that the resource cannot be created because italready exists (step 590). If an instance of the resource does not existwithin the second installation scope, then a determination is made as towhether or not an instance of the resource exists within the systemscope (step 592). When an instance of the resource exists within thesystem scope, an error condition may be returned to the requesterindicating that the resource cannot be created because it already exists(step 590). In some embodiments, the request used to open the resourcemay specify that any extant system-scope instance of the resource may beoverwritten. If the system-scope resource instance does not exist,either of the installation-scope resource instances may be identified asthe literal instance which is created to fulfill the request (step 594).

By comparing FIG. 6B with FIGS. 6C and 6D, it can be seen that installmode operates in a similar manner to execute mode, with the installationscope taking the place of the user scope. In other words, modificationsto persistent resources, including creation of new resources, take placein the appropriate installation scope instead of the appropriate userscope. Furthermore, virtualization of access to existing isolatedresources also ignores the appropriate user scope and begins searchingfor a candidate literal resource in the installation scope.

There are two other cases where the installation scope operates in thismanner to contain modifications to existing resources and creation ofnew resources. Firstly, there may be an isolation environment 260configured to operate without a user layer, or a virtual scope 262configured to operate without a user scope. In this case, theinstallation scope is the only scope that can isolate modified and newlycreated resources. Secondly, the rules governing a particular set ofvirtual resources may specify that they are to be isolated into theappropriate installation scope rather than into the appropriate userscope. Again, this means modifications to and creations of resourcessubject to that rule are isolated in the appropriate installation scopewhere they are visible to all application instances sharing that scope,rather than in the user scope where they are only visible to the userexecuting those application instances.

In still other embodiments, an isolation environment 260 may beconfigured to allow certain resources to be shared in the system scope,that is, the isolation environment 260 may act, for one or more systemresources, as if no user scope and no installation scope exists. Systemresources shared in the system scope are not copied when accessed withthe intent to modify, because they are shared by all applications andall users, i.e., they are global objects.

Illustrated in FIG. 7 is an embodiment of a method 301 for installing anapplication into an isolation environment 260. An isolation environment260 is defined (step 303), and a first association is created betweenthe first application and the first installation scope (step 306). Uponcreation of the first association, a determination is made as to whetheror not an instance of a second application is required for the firstapplication to execute (step 309). If a determination is made indicatingthat no additional application instances are needed to install theapplication within the isolation environment 260, then the firstassociation is stored (step 330), and the first application is launchedinto the isolation environment 260 (step 327). If a determination ismade indicating that additional application instances are needed toinstall the application within the isolation environment, then an imageof the second application is mounted onto a second installation scope(step 312). A second association between the second application and thesecond installation scope is created (step 315), and an associationbetween the first installation scope and the second installation scopeis created (step 318). Between a third installation scope and theaggregation of the first installation scope and the second installationscope, a third association is created (step 321). The first association,the second association, and the third association are then stored withina memory element (step 324).

Further referring to FIG. 7 in more detail, an embodiment of the method301 includes defining an isolation environment 260 (step 303) within theoperating system 210. Other embodiments of the method 301 may define theisolation environment 260 within a separate memory element orapplication located outside the operation system 210 but included withinthe computing machine 200. In one embodiment of the method 301, theisolation environment 260 is located on a third computing machine (notillustrated) in communication with the computing machine 200 butinstalled in a location remote from the location where the computingmachine 200 is installed. An isolation environment 260, in someembodiments, is not defined within the operating system 210 but ratherthe installation root 214 and the user root 212 are included as separateentities on the computing machine 200.

In one embodiment of the method 301, an association is created betweenthe first application and a first installation scope (step 306). Thefirst association, in this embodiment, can be created using anidentifier that is common to both the first application and the firstinstallation scope. Another embodiment of the method 301 may create theassociation by entering an entry into a table, list, or other documentfor tracking associations created between applications and installationscopes. Still other embodiments of the method 301 includes saving avirtual object onto the computing machine 200 representative of theassociation created between the first association and the firstinstallation scope.

A determination is made, in one embodiment of the method 301, as towhether or not the first application requires the presence of a secondapplication to properly execute (step 309). Applications can, in someembodiments of the method 301, require the presence of anotherapplication in order to properly execute on the computing machine 200.An example of this would be a document management program applicationthat includes resources that reference resources within a second programapplication such that the document management program application relieson the existence of the resources within a second program application toproperly execute. When it is determined that the first applicationrequires a second application to properly execute, the first associationis stored in a memory element (step 330), and the first application islaunched into the isolation environment 260 (step 327). Otherembodiments of the method 301 launch the application into the thirdinstallation scope, while still other embodiments launch the applicationinto the user scope.

If a determination is made that an instance of a second application isrequired for the first application to execute, the in one embodiment ofmethod 301, an image of the required second application is mounted ontoa second installation scope (step 312). Other embodiments of the method301 can mount the application into the first installation scope. Stillother embodiments of the method 301 can mount a modified version of theapplication onto either a second installation scope, or the firstinstallation scope.

Embodiments of the method 301 then create a second association betweenthe second application and the second installation scope (step 315). Inthis embodiment, a further association is made between the firstinstallation scope and the second installation scope (step 318). In someembodiments of the method 301, the association between the secondapplication and the second installation scope occurs when the secondapplication is mounted onto the second installation scope (step 312).Other embodiments of the method 301 include an association between thefirst installation scope and the second installation scope that iscreated in a separate installation scope. Still other embodiments of themethod 301 create an association between the first installation scopeand the second installation scope by aggregating each scope into asingle installation scope; while other embodiments create an associationbetween the first installation scope and the second installation scopeby doing any one of the following: creating a virtual objectrepresentative of the association between the first installation scopeand the second installation scope; generating an entry, representativeof the association, into a table, database, file, or other data trackingobject; or adding identifiers to either installation scope to indicatethat each of the first installation scope and the second installationscope should be associated with each other.

In one embodiment of the method 301, a third association is createdbetween a third installation scope and the aggregation of the firstinstallation scope and the second installation scope (step 321). Otherembodiments of the method 301 create a third installation scope thatincludes the first installation scope and the second installation scope.Still other embodiments include a third installation scope that createsa common association between the third installation scope, the firstinstallation scope, and the second installation scope withoutaggregating each of the first and second installation scopes.

The first association, second association, and third association arestored (step 324), and the first application is launched into theisolation environment 260 (step 327). In other embodiments of the method301, each created association is stored in a memory element, where morethan three associations may be stored therein. Still other embodimentsmay include associations that are “stored” in the sense that entries arestored in a table, list, or other data tracking object, where each entrycatalogues the associations created.

While the embodiment illustrated in FIG. 7 depicts a method 301 thatreviews only a first and second application and a first and secondinstallation scope, other embodiments of the method 301 can review morethan two application and more than two installation scopes. Still otherembodiments can review an X number of applications and a Y number ofinstallation scopes, where X is representative of a whole number greaterthan two, and Y is representative of a whole number greater than twothat is a different number value than the number value represented by X.

Detailed Virtualization Examples

The methods and apparatus described above may be used to virtualize awide variety of native resources 258. A number of these are described indetail below.

File System Virtualization

The methods and apparatus described above may be used to virtualizeaccess to a file system. As described above, a file system is commonlyorganized in a logical hierarchy of directories, which are themselvesfiles and which may contain other directories and data files.

In brief overview, FIG. 8 depicts one embodiment of the steps taken toopen a file in the virtualized environment described above. A request toopen a file is received or intercepted (step 602). The request containsa file name, which is treated as a virtual file name by the isolationenvironment 260. The processing rule applicable to the target of thefile system open request is determined (step 604). If the rule action is“redirect” (step 642), the virtual file name provided in the request ismapped to a literal file name according to the applicable rule (step606). A request to open the literal file using the literal file name ispassed to the operating system 210 and the result from the operatingsystem 210 is returned to the requestor (step 640). If instead the ruleaction is “ignore” (step 642), then the literal file name is determinedto be exactly the virtual file name (step 608), and the request to openthe literal file is passed to the operating system 210 and the resultfrom the operating system 210 is returned to the requester (step 640).If in step 642 the rule action is “isolate”, then the file namecorresponding to the virtual file name in the user scope is identifiedas the candidate file name (step 610). In other words, the candidatefile name is formed by mapping the virtual file name to thecorresponding native file name specific to the applicable user scope.The category of existence of the candidate file is determined byexamining the user scope and any metadata associated with the candidatefile (step 612). If the candidate file is determined to have “negativeexistence”, because either the candidate file or one of its ancestordirectories in the user scope is marked as deleted, this means therequested virtual file is known to not exist. In this case, an errorcondition indicating the requested file is not found is returned to therequestor (step 616). If instead in step 612 the candidate file isdetermined to have “positive existence”, then because the candidate fileexists in the user scope and the candidate file is not marked as aplaceholder node, the requested virtual file is known to exist. Thecandidate file is identified as the literal file for the request (step620), and a request issued to open the literal file and the resultreturned to the requester (step 630). If, however, in step 612, thecandidate file has “neutral existence” because the candidate file doesnot exist, or the candidate file exists but is marked as a placeholdernode, it is not yet known whether the virtual file exists or not. Inthis case a subroutine is called to retrieve an installation-scope filename corresponding to the virtual file name, identify foundinstallation-scope file names as candidate file names, and categorizethe existence of the identified candidate files by examining theinstallation scopes and any metadata associated with the identifiedcandidate files (step 614). In one embodiment, the subroutine called isan embodiment of the subroutine depicted in FIG. 12. This subroutinesearches through the one or more installation scopes included in theisolation environment 260 to determine whether or not the candidate filename exists within the one or more installation scopes. In oneembodiment of the subroutine, a value is returned by the subroutineindicating whether or not the candidate file exists within any of themore or more installation scopes. If the value returned from thesubroutine indicates that the candidate file has “negative existence”,because either the candidate file or one of its ancestor directories inthe installation scope is marked as deleted, this means the requestedvirtual file is known to not exist. In this case, an error conditionindicating the requested file is not found is returned to the requester(step 616). If instead in step 614 the value returned from thesubroutine indicates that the candidate file is determined to have“positive existence”, because the candidate file exists in at least oneof the installation scopes and is not marked as a placeholder node, thenthe requested virtual file is known to exist. The request is checked todetermine if the open request indicates an intention to modify the file(step 622). If not, the candidate file is identified as the literal filefor the request (step 620), and a request issued to open the literalfile and the result returned to the requester (step 630). If, however,in step 622, it is determined that the open request indicates intentionto modify the file, permission data associated with the file is checkedto determine if modification of the file is allowed (step 636). If not,an error condition is returned to the requester (step 638) indicatingthat modification of the file is not allowed. If the permission dataindicates that the file may be modified, the candidate file is copied tothe user scope (step 634). In some embodiments, the candidate file iscopied to a location defined by the rules engine. For example, a rulemay specify that the file is copied to an installation scope. In otherembodiments the rules may specify a particular installation sub-scope oruser sub-scope to which the file should be copied. Any ancestors of therequested file that do not appear in the scope to which the file iscopied are created as placeholders in the scope in order to correctlylocate the copied instance in the hierarchy. The scoped instance isidentified as the literal file (step 632) and a request issued to openthe literal file and the result returned to the requester (step 630).Returning to step 614, if the candidate file has neutral existencebecause the candidate file does not exist, or because the candidate fileis found but marked as a placeholder node, it is not yet known whetherthe virtual file exists or not. In this case, the system-scope file namecorresponding to the virtual file name is identified as the candidatefile name (step 628). In other words, the candidate file name is exactlythe virtual file name. If the candidate file does not exist (step 626),an error condition indicating the virtual file was not found is returnedto the requester (step 624). If on the other hand the candidate fileexists (step 626), the request is checked to determine if the openrequest indicates an intention to modify the file (step 622). If not,the candidate file is identified as the literal file for the request(step 620), and a request issued to open the literal file and the resultreturned to the requester (step 630). If, however, in step 622, it isdetermined that the open request indicates intention to modify the file,permission data associated with the file is checked to determine ifmodification of the file is allowed (step 636). If not, an errorcondition is returned to the requester (step 638) indicating thatmodification of the file is not allowed. If the permission dataindicates that the file may be modified, the candidate file is copied tothe user scope (step 634). In some embodiments, the candidate file iscopied to a location defined by the rules engine. For example, a rulemay specify that the file is copied to an installation scope. In otherembodiments the rules may specify a particular installation sub-scope oruser sub-scope to which the file should be copied. Any ancestors of therequested file that do not appear in the scope are created asplaceholders in the scope to correctly locate the copied instance in thehierarchy. The scoped instance is identified as the literal file (step632) and a request issued to open the literal file and the resultreturned to the requester (step 630).

This embodiment can be trivially modified to perform a check forexistence of a file rather than opening a file. The attempt to open theliteral file in step 630 is replaced with a check for the existence ofthat literal file and that status returned to the requester.

Still referring to FIG. 8 and now in more detail, a request to open avirtual file is received or intercepted (step 602). The correspondingliteral file may be of user scope, installation scope or system scope,or it may be scoped to an installation sub-scope or a user sub-scope. Insome embodiments, the request is hooked by a function that replaces theoperating system 210 function or functions for opening a file. Inanother embodiment a hooking dynamically-linked library is used tointercept the request. The hooking function may execute in user mode orin kernel mode. For embodiments in which the hooking function executesin user mode, the hooking function may be loaded into the address spaceof a process when that process is created. For embodiments in which thehooking function executes in kernel mode, the hooking function may beassociated with an operating system 210 resource that is used indispatching requests for native files. For embodiments in which aseparate operating system 210 function is provided for each type of fileoperation, each function may be hooked separately. Alternatively, asingle hooking function may be provided which intercepts create or opencalls for several types of file operations.

The request contains a file name, which is treated as a virtual filename by the isolation environment 260. The processing rule applicable tothe file system open request is determined (step 604) by consulting therules engine. In some embodiments the processing rule applicable to theopen request is determined using the virtual name included in the openrequest. In some embodiments, the rules engine may be provided as arelational database. In other embodiments, the rules engine may be atree-structured database, a hash table, or a flat file database. In someembodiments, the virtual file name provided for the requested file isused as an index into the rule engine to locate one or more rules thatapply to the request. In particular ones of these embodiments, multiplerules may exist in the rules engine for a particular file and, in theseembodiments, the rule having the longest prefix match with the virtualfile name is the rule applied to the request. In other embodiments, aprocess identifier is used to locate in the rule engine a rule thatapplies to the request, if one exists. The rule associated with arequest may be to ignore the request, redirect the request, or isolatethe request. Although shown in FIG. 6 as a single database transactionor single lookup into a file, the rule lookup may be performed as aseries of rule lookups.

If the rule action is “redirect” (step 642), the virtual file nameprovided in the request is mapped to a literal file name according tothe applicable rule (step 606). A request to open the literal fileidentified by the literal file name is passed to the operating system210 and the result from the operating system 210 is returned to therequestor (step 640). For example, a request to open a file named“file_1” may result in the opening of a literal file named“Different_file_1”.

In one embodiment, this is accomplished by calling the original versionof the hooked function and passing the formed literal name to thefunction as an argument. For embodiments using a file system filterdriver, the first request to open the file using the virtual nameresults in the return of a STATUS_REPARSE response from the file systemfilter driver indicating the determined literal name. The I/O Managerthen reissues the file open request with the determined literal nameinclude in the STATUS_REPARSE response.

If instead the rule action is “ignore” (step 642), then the literal filename is determined to be exactly the virtual file name (step 608), andthe request to open the literal file is passed to the operating system210 and the result from the operating system 210 is returned to therequester (step 640). For example, a request to open a file named“file_1” results in the opening of an actual file named “file_1”. In oneembodiment, this is accomplished by calling the original version of thehooked function and passing the formed literal name to the function asan argument.

If in step 642 the rule action is “isolate”, then the user-scoped filename corresponding to the virtual file name is identified as thecandidate file name (step 610). In other words, the candidate file nameis formed by mapping the virtual file name to the corresponding nativefile name specific to the applicable user scope. For example, a requestto open a file named “file_1” may result in the opening of an actualfile named “Isolated_file_1”. In one embodiment, this is accomplished bycalling the original version of the hooked function and passing theformed literal name to the function as an argument. For embodimentsusing a file system filter driver, the first request to open the fileusing the virtual name results in the return of a STATUS_REPARSEresponse from the file system filter driver indicating the determinedliteral name. The I/O Manager then reissues the file open request withthe determined literal name include in the REPARSE response.

In some embodiments, the literal name formed in order to isolate arequested system file may be based on the virtual file name received anda scope-specific identifier. The scope-specific identifier may be anidentifier associated with an installation scope, a user scope, asession scope, an installation sub-scope, a user sub-scope, or somecombination of the above. The scope-specific identifier is used to“mangle” the virtual name received in the request.

In other embodiments, the user scope or a sub-scope may be a directoryunder which all files that exist in the user scope are stored. In someof these embodiments, the directory tree structure under the userdirectory reflects the path of the requested resource. In other words,the literal file path is formed by mapping the virtual file path to theuser scope. For example, if the requested file is c:\temp\test.txt andthe user scope directory is d:\user1\app1\, then the path to theuser-scope literal file may be d:\user1\app1\c\temp\test.txt. In otherembodiments, the path to the user-scope literal may be defined in anative naming convention. For example, the path to the user-scopeliteral file may be d:\user1\app1\device\harddisk1\temp\test.txt. Instill other embodiments, the user-scope files may all be stored in asingle directory with names chosen to be unique and a database may beused to store the mapping between the requested file name and the nameof the corresponding literal file stored in the directory. In stillother embodiments, the contents of the literal files may be stored in adatabase. In still other embodiments, the native file system providesthe facility for a single file to contain multiple independent named“streams”, and the contents of the user-scope files are stored asadditional streams of the associated files in the system scope.Alternatively, the literal files may be stored in a custom file systemthat may be designed to optimize disk usage or other criteria ofinterest.

The category of existence of the candidate file is determined byexamining the user scope and any metadata associated with the candidatefile (step 612). If the candidate file is determined to have “negativeexistence”, because either the candidate file or one of its ancestordirectories in the user scope is marked as deleted, this means therequested virtual file is known to not exist. In this case, an errorcondition indicating the requested file is not found is returned to therequester (step 616).

In some embodiments, small amounts of metadata about a file may bestored directly in the literal filename, such as by suffixing thevirtual name with a metadata indicator, where a metadata indicator is astring uniquely associated with a particular metadata state. Themetadata indicator may indicate or encode one or several bits ofmetadata. Requests to access the file by virtual filename check forpossible variations of the literal filename due to the presence of ametadata indicator, and requests to retrieve the name of the file itselfare hooked or intercepted in order to respond with the literal name. Inother embodiments, one or more alternate names for the file may beformed from the virtual file name and a metadata indicator, and may becreated using hard link or soft link facilities provided by the filesystem. The existence of these links may be hidden from applications bythe isolation environment 260 by indicating that the file is not foundif a request is given to access a file using the name of a link. Aparticular link's presence or absence may indicate one bit of metadatafor each metadata indicator, or there may be a link with a metadataindicator that can take on multiple states to indicate several bits ofmetadata. In still other embodiments, where the file system supportsalternate file streams, an alternate file stream may be created toembody metadata, with the size of the stream indicating several bits ofmetadata. In still other embodiments, a file system may directly providethe ability to store some third-party metadata for each file in the filesystem.

In specific ones of these embodiments, a list of deleted files or filesystem elements may be maintained and consulted to optimize this checkfor deleted files. In these embodiments, if a deleted file is recreatedthen the file name may be removed from the list of deleted files. Inothers of these embodiments, a file name may be removed from the list ifthe list grows beyond a certain size.

If instead the candidate file is determined to have “positiveexistence”, because the candidate file exists in the user scope and isnot marked as a placeholder node, then the requested virtual file isknown to exist. The candidate file is identified as the literal file forthe request (step 620), and a request issued to open the literal fileand the result returned to the requester (step 630).

If, however, the candidate file has a “neutral existence” because thecandidate file does not exist, or the candidate file exists but ismarked as a placeholder node, it is not yet known whether the virtualfile exists or not. In this case a call is made to a subroutine thatsearches through the one or more installation scopes to retrieve aninstallation-scope file name and identify the virtual file name as thecandidate file name (step 614). In other words, the candidate file nameis formed by mapping the virtual file name to the corresponding nativefile name specific to an installation scope identified as theinstallation scope within which a corresponding native file name may befound. In one embodiment, once the subroutine identifies a candidatefile, the subroutine then can determine the category of existence of thecandidate file by examining the installation scope and any metadataassociated with the candidate file (step 614). The subroutine, in oneembodiment, returns a value indicative of the category of existence ofthe candidate file (step 614).

If the value returned by the subroutine indicates that theinstallation-scope candidate file has a “negative existence”, and thenin one embodiment this “negative existence” is a result of either thecandidate file or one of its ancestor directories in the installationscope being marked as deleted, this means the requested virtual file isknown to not exist. In this embodiment, an error condition indicatingthe requested file is not found is returned to the requester (step 616).

If in step 614 the value returned by the subroutine indicates that thecandidate file has a “positive existence,” and the candidate file existsin the installation scope and is not marked as a placeholder node, thenthe requested virtual file is known to exist. The request is checked todetermine if the open request indicates an intention to modify the file(step 622). If not, the candidate file is identified as the literal filefor the request (step 620), and a request issued to open the literalfile and the result returned to the requester (step 630).

If, however, in step 622, it is determined that the open requestindicates intention to modify the file, permission data associated withthe file is checked to determine if modification of the file is allowed(step 636). In some embodiments, the permission data is associated withthe installation-scope candidate file. In some of these embodiments, thepermissions data is stored in a rules engine or in metadata associatedwith the candidate file. In other embodiments, the permission dataassociated with the candidate file is provided by the operating system210. Further, the rules engine may include configuration settingsinstructing the isolation environment 260 to obey or override the nativepermission data for virtualized copies of resources. In someembodiments, the rules may specify for some virtual resources the scopein which modifications are to occur, for example the system scope or theinstallation scope or a sub-scope, or the user scope or a sub-scope. Insome embodiments, the rules engine may specify configuration settingsthat apply to subsets of the virtualized native resources based onhierarchy or on the type of resource accessed. In some of theseembodiments, the configuration settings may be specific to each nativeresource. In another example, the rules engine may include configurationdata that prohibits or allows modification of certain classes of files,such as executable code or MIME types or file types as defined by theoperating system 210.

If the permission data associated with the candidate file indicates thatit may not be modified, an error condition is returned to the requester(step 638) indicating that modification of the file is not allowed. Ifthe permission data indicates that the file may be modified, thecandidate file is copied to the user scope (step 634). In someembodiments, the candidate file is copied to a location defined by therules engine. For example, a rule may specify that the file is copied toanother installation scope. In other embodiments the rules may specify aparticular installation sub-scope or user sub-scope to which the fileshould be copied. Any ancestors of the requested file that do not appearin the scope to which the file is copied are created as placeholders inthe scope in order to correctly locate the copied instance in thehierarchy.

In some embodiments, metadata is associated with files copied to thescope that identifies the date and time at which the files were copied.This information may be used to compare the time stamp associated withthe copied instance of the file to the time stamp of the lastmodification of the original instance of the file or of another instanceof the file located in a lower isolation scope. In these embodiments, ifthe original instance of the file, or an instance of the file located ina lower scope, is associated with a time stamp that is later than thetime stamp of the copied file, that file may be copied to the scope toupdate the candidate file. In other embodiments, the copy of the file inthe scope may be associated with metadata identifying the scopecontaining the original file that was copied.

In further embodiments, files that are copied to scopes because theyhave been opened with intent to modify them may be monitored todetermine if they are, in fact, modified. In one embodiment a copiedfile may be associated with a flag that is set when the file is actuallymodified. In these embodiments, if a copied file is not actuallymodified, it may be removed from the scope to which it was copied afterit is closed, as well as any placeholder nodes associated with thecopied file. The scoped instance is identified as the literal file (step632) and a request issued to open the literal file and the resultreturned to the requestor (step 630).

Returning to step 614, if the candidate file has neutral existencebecause the candidate file does not exist, or if the candidate file isfound but marked as a placeholder node, it is not yet known whether thevirtual file exists or not. In this case, the system-scope file namecorresponding to the virtual file name is identified as the candidatefile name (step 628). In other words, the candidate file name is exactlythe virtual file name.

If the candidate file does not exist (step 626), an error conditionindicating the virtual file was not found is returned to the requester(step 624). If on the other hand the candidate file exists (step 626),the request is checked to determine if the open request indicates anintention to modify the file (step 622).

As above, if the candidate file is being opened without the intent tomodify it, the system-scope candidate file is identified as the literalfile for the request (step 620), and a request issued to open theliteral file and the result returned to the requester (step 630). If,however, in step 622, it is determined that the open request indicatesintention to modify the file, permission data associated with the fileis checked to determine if modification of the file is allowed (step636). In some embodiments, the permission data is associated with thesystem-scope candidate file. In some of these embodiments, thepermissions data is stored in a rules engine or in metadata associatedwith the candidate file. In other embodiments, the permission dataassociated with the candidate file is provided by the operating system210.

If the permission data associated with the system-scope candidate fileindicates that the file may not be modified, an error condition isreturned to the requester (step 638) indicating that modification of thefile is not allowed. If, however, the permission data indicates that thefile may be modified, the candidate file is copied to the user scope(step 634). In some embodiments, the candidate file is copied to alocation defined by the rules engine. For example, a rule may specifythat the file is copied to an installation scope or that it may be leftin the system scope. In other embodiments the rules may specify aparticular installation sub-scope or user isolation sub-scope to whichthe file should be copied. Any ancestors of the requested file that donot appear in the scope are created as placeholders in the scope inorder to correctly locate the copied instance in the hierarchy.

In some embodiments, metadata is associated with files copied to thescope that identifies the date and time at which the files were copied.This information may be used to compare the time stamp associated withthe copied instance of the file to the time stamp of the lastmodification of the original instance of the file. In these embodiments,if the original instance of the file is associated with a time stampthat is later than the time stamp of the copied file, the original filemay be copied to the scope to update the candidate file. In otherembodiments, the candidate file copied to the scope may be associatedwith metadata identifying the scope from which the original file wascopied.

In further embodiments, files that are copied to scopes because theyhave been opened with intent to modify them may be monitored todetermine if they are, in fact, modified. In one embodiment a copiedfile may be associated with a flag that is set when the file is actuallymodified. In these embodiments, if a copied file is not actuallymodified, when it is closed it may be removed from the scope to which itwas copied, as well as any placeholder nodes associated with the copiedfile. In still further embodiments, the file is only copied to theappropriate scope when the file is actually modified.

The scoped instance is identified as the literal file (step 632) and arequest issued to open the literal file and the result returned to therequester (step 630).

Referring now to FIG. 9, and in brief overview, one embodiment of thesteps taken to delete a file is depicted. A request to delete a file isreceived or intercepted (step 652). The request contains a file name,which is treated as a virtual file name by the isolation environment260. A rule determines how the file operation is processed (step 654).If the rule action is “redirect” (step 656), the virtual file name ismapped directly to a literal file name according to the rule (step 658).A request to delete the literal file is passed to the operating system210 and the result from the operating system 210 is returned to therequester (step 662). If the rule action is “ignore” (step 656), thenthe literal file name is identified as exactly the virtual file name(step 660), and a request to delete the literal file is passed to theoperating system 210 and the result from the operating system 210 isreturned to the requester (step 662). If the rule action is “isolate”(step 656), then the existence of the virtual file is determined (step664). If the virtual file does not exist, an error condition is returnedto the requester indicating that the virtual file does not exist (step665). If the virtual file exists, and if the virtualized file specifiesa directory rather than an ordinary file, the virtual directory isconsulted to determine if it contains any virtual files or virtualsubdirectories (step 668). If the requested virtualized file is avirtual directory that contains any virtual files or virtualsubdirectories, the virtual directory cannot be deleted and an errormessage is returned (step 670). If the requested virtualized file is anordinary file or is a virtual directory that contains no virtual filesand no virtual subdirectories, then the literal file corresponding tothe virtual file is identified (step 672). Permission data associatedwith the file is checked to determine if deletion is allowed (step 676).If not, a permission error message is returned (step 678). If, however,deletion of the file is allowed, and if the literal file is in theappropriate user scope (step 674), the literal file is deleted (step680) and a “deleted” node representing the deleted virtual file iscreated in the appropriate user scope (step 684). If, however, in step674 it is determined that the literal file is not in the user scope butis in the appropriate installation scope or the system scope, then aninstance of user-scoped ancestors of the user-scope instance of therequested file that does not already exist is created and marked as aplaceholder (step 686). This is done to maintain the logical hierarchyof the directory structure in the user scope. A user-scoped “deleted”node representing the deleted virtual file is then created in theappropriate user scope (step 684).

Still referring to FIG. 9, and in more detail, a request to delete afile is received or intercepted (step 652). The file may be of userscope, installation scope, system scope, or some applicable sub-scope.In some embodiments, the request is hooked by a function that replacesthe operating system 210 function or functions for deleting the file. Inanother embodiment a hooking dynamically-linked library is used tointercept the request. The hooking function may execute in user mode orin kernel mode. For embodiments in which the hooking function executesin user mode, the hooking function may be loaded into the address spaceof a process when that process is created. For embodiments in which thehooking function executes in kernel mode, the hooking function may beassociated with an operating system 210 resource that is used indispatching requests for native files. For embodiments in which aseparate operating system 210 function is provided for each type offile, each function may be hooked separately. Alternatively, a singlehooking function may be provided which intercepts create or open callsfor several types of files.

The request contains a file name, which is treated as a virtual filename by the isolation environment 260. A processing rule applicable tothe delete operation is determined (step 654) by consulting the rulesengine. In some embodiments, the virtual file name provided for therequested file is used to locate in the rule engine a rule that appliesto the request. In particular ones of these embodiments, multiple rulesmay exist in the rules engine for a particular file and, in theseembodiments, the rule having the longest prefix match with the virtualfile name is the rule applied to the request. In some embodiments, therules engine may be provided as a relational database. In otherembodiments, the rules engine may be a tree-structured database, a hashtable, or a flat file database. In some embodiments, the virtual filename provided in the request is used as an index into a rules engine tolocate one or more rules that apply to the request. In otherembodiments, a process identifier is used to locate in the rule engine arule that applies to the request, if one exists. The rule associatedwith a request may be to ignore the request, redirect the request, orisolate the request. Although shown in FIG. 9 as a series of decisions,the rule lookup may occur as a single database transaction.

If the rule action is “redirect” (step 656), the virtual file name ismapped directly to a literal file name according to the applicable rule(step 658). A request to delete the literal file is passed to theoperating system 210 and the result from the operating system 210 isreturned to the requester (step 662). For example, a request to delete afile named “file_1” may result in the deletion of an actual file named“Different_file_1”. In one embodiment, this is accomplished by callingthe original version of the hooked function and passing the formedliteral name to the function as an argument. For embodiments using afile system filter driver, the first request to delete the file usingthe virtual name results in the return of a STATUS_REPARSE response fromthe file system filter driver indicating the determined literal name.The I/O Manager then reissues the file delete request with thedetermined literal name include in the STATUS_REPARSE response.

In some embodiments, operating system 210 permissions associated withthe literal file “Different_file_1” may prevent deletion of the literalfile. In these embodiments, an error message is returned that the filecould not be deleted.

If the rule action is “ignore” (step 656), then the literal file name isidentified as exactly the virtual file name (step 660), and a request todelete the literal file is passed to the operating system 210 and theresult from the operating system 210 is returned to the requester (step662). For example, a request to delete a file named “file_1” results inthe deletion of an actual file named “file_1”. In one embodiment, thisis accomplished by calling the original version of the hooked functionand passing the formed literal name to the function as an argument. Forembodiments using a file system filter driver, the first request todelete the file using the virtual name results in the return of aSTATUS_REPARSE response from the file system filter driver indicatingthe literal name. The I/O Manager then reissues the file delete requestwith the determined literal name include in the STATUS_REPARSE response.

In some embodiments, operating system 210 permissions associated withthe literal file “file_1” may prevent deletion of the literal file. Inthese embodiments, an error message is returned that the file could notbe deleted. If the rule action is “isolate” (step 656), then theexistence of the virtual file is determined (step 664). If the file doesnot exist, an error is returned indicating that the file is not found(step 665). If, however, in step 668 it is determined that the fileexists but that it is not an ordinary file and is not an empty virtualdirectory, i.e., it contains virtual files or virtual subdirectories, anerror message is returned indicating that the file may not be deleted(step 670).

If, however, the file is determined to exist and the requestedvirtualized file is an ordinary file or is an empty virtual directory,i.e., it contains no virtual files and no virtual subdirectories (step668), then the literal file corresponding to the virtual file isidentified (step 672). The literal file name is determined from thevirtual file name as specified by the isolation rule. For example, arequest to delete a file named “file_1” may result in the deletion of anactual file named “Isolated_file_1”. In one embodiment, this isaccomplished by calling the original version of the hooked function andpassing the formed literal name to the function as an argument. Forembodiments using a file system filter driver, the first request todelete the file using the virtual name results in the return of aSTATUS_REPARSE response from the file system filter driver indicatingthe literal name. The I/O Manager then reissues the file delete requestwith the determined literal name include in the STATUS_REPARSE response.

Once the literal file corresponding to the virtual file is identified,it is determined whether the literal file may be deleted (step 676). Ifthe file may not be deleted, an error is returned indicating that thefile could not be deleted (step 676). In some embodiments, thepermission data is associated with the system-scope candidate file. Insome of these embodiments, the permissions data is stored in a rulesengine or in metadata associated with the candidate file. In otherembodiments, the permission data associated with the candidate file isprovided by the operating system 210. If, however, deletion of the fileis allowed, and if the literal file is in the appropriate user scope(step 674), the literal file is deleted (step 680) and a “deleted” noderepresenting the deleted virtual file is created in the appropriate userscope (step 684). If, however, in step 674 it is determined that theliteral file is not in the user scope but is in the appropriateinstallation scope or the system scope, then an instance of user-scopeancestors of the user-scope instance of the requested file that does notalready exist is created and marked as a placeholder (step 686). This isdone to maintain the logical hierarchy of the directory structure in theuser scope. A user-scope “deleted” node representing the deleted virtualfile is then created in the appropriate user scope (step 684). In someembodiments, the identity of the deleted file is stored in a file orother cache memory to optimize checks for deleted files.

In some embodiments, the located virtualized file may be associated withmetadata indicating that the virtualized file has already been deleted.In some other embodiments, an ancestor of the virtualized file (e.g., ahigher directory containing the file) is associated with metadataindicating that it is deleted. In these embodiments, an error messagemay be returned indicating that the virtualized file does not exist. Inspecific ones of these embodiments, a list of deleted files or filesystem elements may be maintained and consulted to optimize this checkfor deleted files.

Referring now to FIG. 10, and in brief overview, one embodiment of thesteps taken to enumerate a directory in the described virtualizedenvironment is shown. A request to enumerate is received or intercepted(step 760). The request contains a directory name that is treated as avirtual directory name by the isolation environment 260. Conceptually,the virtual directory's existence is determined as described above (step762). If the virtual directory does not exist, a result indicating thatthe virtual directory is not found is returned to the requestor (step796). If instead the virtual directory exists, the rules engine isconsulted to determine the rule for the directory specified in theenumerate request (step 764). If the rule specifies an action of“redirect” (step 766), the literal directory name corresponding to thevirtual directory name is determined as specified by the rule (step 768)and the literal directory identified by the literal name is enumerated,and the enumeration results stored in a working data store (step 792),followed by step 790 as described later. If the rule action specified isnot “redirect” and is “ignore,” (step 772) the literal directory name isexactly the virtual directory name (step 770) and the literal directoryis enumerated, and the enumeration results stored in a working datastore (step 792), followed by step 790 as described later. If, however,the rule action specifies “isolate,” firstly the system scope isenumerated; that is, the candidate directory name is exactly the virtualdirectory name, and if the candidate directory exists it is enumerated.The enumeration results are stored in a working data store. If thecandidate directory does not exist, the working data store remains emptyat this stage (step 774). Next, a subroutine executes to identify ascope candidate in the installation scopes (step 776). A candidate isreturned by the subroutine (step 776), and the candidate directory isidentified as the installation-scope instance of the virtual directory,and the category of existence of the candidate directory is determined(step 778). If the candidate directory has “negative existence”, i.e. itor one of its ancestors in the scope is marked as deleted, then withinthis scope it is known to be deleted, and this is indicated by flushingthe working data store (step 780). If instead the candidate directorydoes not have negative existence, the candidate directory is enumeratedand any enumeration results obtained are merged into the working datastore. In particular, for each file system element in the enumeration,its category of existence is determined. Elements with negativeexistence are removed from the working data store and elements withpositive existence, i.e. those that exist and are not marked asplaceholders and are not marked as deleted, are added to the workingdata store, replacing the corresponding element if one is alreadypresent in the working data store (step 782).

In either case, the candidate directory is identified as the user-scopeinstance of the virtual directory, and the category of existence of thecandidate directory is determined (step 784). If the candidate directoryhas “negative existence”, i.e. it or one of its ancestors in the scopeis marked as deleted, then within this scope it is known to be deleted,and this is indicated by flushing the working data store (step 786). Ifinstead the candidate directory does not have negative existence, thecandidate directory is enumerated and any enumeration results obtainedare merged into the working data store. In particular, for each filesystem element in the enumeration, its category of existence isdetermined. Elements with negative existence are removed from theworking data store, and elements with positive existence, i.e. thosethat exist and are not marked as placeholders and are not marked asdeleted, are added to the working data store, replacing thecorresponding element if one is already present in the working datastore (step 788), followed by step 790 as described below.

Then, for all three types of rules, step 790 is executed. The rulesengine is queried to find the set of rules whose filters match immediatechildren of the requested directory, but do not match the requesteddirectory itself (step 790). For each rule in the set, the existence ofthe virtual child whose name matches the name in the rule is queriedusing the logic outlined above. If the child has positive existence, itis added to the working data store, replacing any child of the same namealready there. If the child has negative existence, the entry in theworking data store corresponding to the child, if any, is removed. (Step794). Finally, the constructed enumeration is then returned from theworking data store to the requestor (step 796).

Still referring to FIG. 10, and in more detail, a request to enumerate adirectory is received or intercepted (step 760). In some embodiments,the request is hooked by a function that replaces the operating systemfunction or functions for enumerating a directory. In anotherembodiment, a hooking dynamically-linked library is used to interceptthe request. The hooking function may execute in user mode or in kernelmode. For embodiments in which the hooking function executes in usermode, the hooking function may be loaded into the address space of aprocess when that process is created. For embodiments in which thehooking function executes in kernel mode, the hooking function may beassociated with an operating system 210 resource that is used indispatching requests for file operations. For embodiments in which aseparate operating system 210 function is provided for each type of fileoperation, each function may be hooked separately. Alternatively, asingle hooking function may be provided which intercepts create or opencalls for several types of file operations.

The existence of the virtual directory is determined (step 762). This isachieved as described above. If the virtual directory does not exist, itcannot be enumerated, and a result indicating that the virtual directorydoes not exist is returned to the requestor (step 796).

The request contains a directory name, which is treated as a virtualdirectory name by the isolation environment 260. If the virtualdirectory exists, then a rule determining how the enumeration operationis to be processed is located (step 764) by consulting the rules engine.In some embodiments, the rules engine may be provided as a relationaldatabase. In other embodiments, the rules engine may be atree-structured database, a hash table, or a flat file database. In someembodiments, the virtual directory name provided for the requesteddirectory is used to locate in the rule engine a rule that applies tothe request. In particular ones of these embodiments, multiple rules mayexist in the rules engine for a particular directory and, in theseembodiments, the rule having the longest prefix match with the virtualdirectory name is the rule applied to the request. In other embodiments,a process identifier is used to locate in the rule engine a rule thatapplies to the request, if one exists. The rule associated with arequest may be to ignore the request, redirect the request, or isolatethe request. Although shown in FIG. 10 as a single database transactionor single lookup into a file, the rule lookup may be performed as aseries of rule lookups.

If the rule action is “redirect” (step 766) the virtual directory nameis mapped directly to a literal directory name according to the rule(step 768). A request to enumerate the literal directory is passed tothe operating system 210 (step 792) and step 790 is executed asdescribed later. For example, a request to enumerate a directory named“directory_1” may result in the enumeration of a literal directory named“Different_directory_1”. In one embodiment, this is accomplished bycalling the original version of the hooked function and passing theformed literal name to the function as an argument. For embodimentsusing a file system filter driver, the first request to open thedirectory for enumeration using the virtual name results in a“STATUS_REPARSE” request response indicating the determined literalname. The I/O Manager then reissues the directory open request forenumeration with the determined literal name include in theSTATUS_REPARSE response.

If the rule action is not “redirect” (step 766), but is “ignore” (step772), then the literal directory name is identified as exactly thevirtual directory name (step 770), and a request to enumerate theliteral directory is passed to the operating system 210 (step 792) andstep 790 is executed as described later. For example, a request toenumerate a directory named “directory_1” results in the enumeration ofan actual directory named “directory_1.” In one embodiment, this isaccomplished by calling the original version of the hooked function andpassing the formed literal name to the function as an argument. Forembodiments using a file system filter driver, the first request toenumerate the directory using the virtual name is passed on unmodifiedby the filter driver.

If the rule action determined in step 772 is not “ignore” but is“isolate”, then the system scope is enumerated, that is, the virtualname provided in the request is used to identify the enumerateddirectory (step 774). The results of the enumeration are stored in aworking data store. In some embodiments, the working data store iscomprised of a memory element. In other embodiments, the working datastore comprises a database or a file or a solid-state memory element ora persistent data store.

Next, a sub-routine is called to check the installation scopes toidentify and return a candidate directory (step 776). The existence ofthe candidate director is then determined (step 778). If the candidatedirectory has “negative existence”, i.e. it or one of its ancestors inthe scope is marked as deleted, then within this scope it is known to bedeleted, and this is indicated by flushing the working data store (step780).

In some embodiments, small amounts of metadata about a file may bestored directly in the literal filename, such as by suffixing thevirtual name with a metadata indicator, where a metadata indicator is astring uniquely associated with a particular metadata state. Themetadata indicator may indicate or encode one or several bits ofmetadata. Requests to access the file by virtual filename check forpossible variations of the literal filename due to the presence of ametadata indicator, and requests to retrieve the name of the file itselfare hooked or intercepted in order to respond with the literal name. Inother embodiments, one or more alternate names for the file may beformed from the virtual file name and a metadata indicator, and may becreated using hard link or soft link facilities provided by the filesystem. The existence of these links may be hidden from applications bythe isolation environment by indicating that the file is not found if arequest is given to access a file using the name of a link. A particularlink's presence or absence may indicate one bit of metadata for eachmetadata indicator, or there may be a link with a metadata indicatorthat can take on multiple states to indicate several bits of metadata.In still other embodiments, where the file system supports alternatefile streams, an alternate file stream may be created to embodymetadata, with the size of the stream indicating several bits ofmetadata. In still other embodiments, a file system may directly providethe ability to store some 3rd party metadata for each file in the filesystem. In yet other embodiment, a separate sub-scope may be used torecord deleted files and existence of a file (not marked as aplaceholder) in that sub-scope is taken to mean that the file isdeleted.

If instead the installation scope candidate directory does not havenegative existence, the candidate directory is enumerated and anyenumeration results obtained are merged into the working data store. Inparticular, for each file system element in the enumeration, itscategory of existence is determined. Elements with negative existenceare removed from the working data store and elements with positiveexistence, i.e. those that exist and are not marked as placeholders andare not marked as deleted, are added to the working data store,replacing the corresponding element if one is already present in theworking data store (step 782).

In either case, the candidate directory is identified as the user-scopeinstance of the virtual directory, and the category of existence of thecandidate directory is determined (step 784). If the candidate directoryhas “negative existence”, i.e. it or one of its ancestors in the scopeis marked as deleted, then within this scope it is known to be deleted,and this is indicated by flushing the working data store (step 786). Ifinstead the candidate directory does not have negative existence, thecandidate directory is enumerated and any enumeration results obtainedare merged into the working data store. In particular, for each filesystem element in the enumeration, its category of existence isdetermined. Elements with negative existence are removed from theworking data store, and elements with positive existence, i.e. thosethat exist and are not marked as placeholders and are not marked asdeleted, are added to the working data store, replacing thecorresponding element if one is already present in the working datastore (step 788), followed by step 790 as described below.

Then, for all three types of rules, step 790 is executed. The rulesengine is queried to find the set of rules whose filters match immediatechildren of the requested directory, but do not match the requesteddirectory itself (step 790). For each rule in the set, the existence ofthe virtual child whose name matches the name in the rule is queriedusing the logic outlined above. If the child has positive existence, itis added to the working data store, replacing any child of the same namealready there. If the child has negative existence, the entry in theworking data store corresponding to the child, if any, is removed. (Step794). Finally, the constructed enumeration is then returned from theworking data store to the requestor (step 796).

A practitioner of ordinary skill in the art realizes that the layeredenumeration process described above can be applied with minormodification to the operation of enumerating a single scope thatincludes a plurality of sub-scopes. A working data store is created,successive sub-scopes are enumerated and the results are merged into theworking data store to form the aggregated enumeration of the scope.

Referring now to FIG. 11, and in brief overview, one embodiment of thesteps taken to create a file in the isolation environment 260 is shown.A request to create a file is received or intercepted (step 702). Therequest contains a file name, which is treated as a virtual file name bythe isolation environment 260. An attempt is made to open the requestedfile using full virtualization using applicable rules, i.e. usingappropriate user and installation scope, as described above (step 704).If access is denied (step 706), an access denied error is returned tothe requester (step 709). If access is granted (step 706), and therequested file is successfully opened (step 710), the requested file isreturned to the requestor (step 712). However, if access is granted(step 706), but the requested file is not opened successfully (step 710)then if the parent of the requested file also does not exist (step 714),an error appropriate to the request semantics is issued to the requester(step 716). If on the other hand, the parent of the requested file isfound in full virtualized view using the appropriate user andinstallation scope (step 714), a rule then determines how the fileoperation is processed (step 718). If the rule action is “redirect” or“ignore” (step 720), the virtual file name is mapped directly to aliteral file name according to the rule. Specifically, if the ruleaction is “ignore”, the literal file name is identified as exactly thevirtual file name. If, instead, the rule action is “redirect”, theliteral file name is determined from the virtual file name as specifiedby the rule. Then a request to create the literal file is passed to theoperating system 210, and the result is returned to the requester (step724). If on the other hand, the rule action determined in step 720 is“isolate”, then the literal file name is identified as the instance ofthe virtual file name in the user scope. If the literal file alreadyexists, but is associated with metadata indicating that it is aplaceholder or that it is deleted, then the associated metadata ismodified to remove those indications, and it is ensured that the file isempty. In either case, a request to open the literal file is passed tothe operating system 210 (step 726). If the literal file was openedsuccessfully (step 728), the literal file is returned to the requester(step 730). If on the other hand, in step 728, the requested file failsto open, placeholders for each ancestor of the literal file that doesnot currently exist in the user scope (step 732) and a request to createthe literal file using the literal name is passed to the operatingsystem 210 and the result is returned to the requestor (step 734).

Still referring to FIG. 11, and in more detail, a request to create afile is received or intercepted (step 702). In some embodiments, therequest is hooked by a function that replaces the operating system 210function or functions for creating the file. In another embodiment, ahooking dynamically-linked library is used to intercept the request. Thehooking function may execute in user mode or in kernel mode. Forembodiments in which the hooking function executes in user mode, thehooking function may be loaded into the address space of a process whenthat process is created. For embodiments in which the hooking functionexecutes in kernel mode, the hooking function may be associated with anoperating system 210 resource that is used in dispatching requests forfiles. For embodiments in which a separate operating system 210 functionis provided for each type of file operation, each function may be hookedseparately. Alternatively, a single hooking function may be providedwhich intercepts create or open calls for several types of fileoperations.

The request contains a file name, which is treated as a virtual filename by the isolation environment 260. The requester attempts to openthe requested file using full virtualization using applicable rules,i.e. using appropriate user and installation scope, as described above(step 704). If access is denied during the full virtualized openoperation (step 706), an access denied error is returned to therequestor (step 709). If access is granted (step 706), and the requestedvirtual file is successfully opened (step 710), the correspondingliteral file is returned to the requester (step 712). However, if accessis granted (step 706), but the requested file is not opened successfully(step 710) then the virtual file has been determined not to exist. Ifthe virtual parent of the requested virtual file also does not exist, asdetermined by the procedures described above (step 714), an errorappropriate to the request semantics is issued to the requester (step716). If on the other hand, the virtual parent of the requested virtualfile is found in full virtualized view using the appropriate user andinstallation scope (step 714), then a rule that determines how thecreate operation is processed is located (step 718) by consulting therules engine. In some embodiments, the rules engine may be provided as arelational database. In other embodiments, the rules engine may be atree-structured database, a hash table, or a flat file database. In someembodiments, the virtual file name provided for the requested file isused to locate in the rule engine a rule that applies to the request. Inparticular ones of these embodiments, multiple rules may exist in therules engine for a particular file and, in some of these embodiments,the rule having the longest prefix match with the virtual file name isthe rule applied to the request. In some embodiments, a processidentifier is used to locate in the rule engine a rule that applies tothe request, if one exists. The rule associated with a request may be toignore the request, redirect the request, or isolate the request.Although shown in FIG. 11 as a single database transaction or singlelookup into a file, the rule lookup may be performed as a series of rulelookups.

If the rule action is “redirect” or “ignore” (step 720), the virtualfile name is mapped directly to a literal file name according to therule (step 724). If the rule action is “redirect” (step 720), theliteral file name is determined from the virtual file name as specifiedby the rule (step 724). If the rule action is “ignore” (step 720), theliteral file name is determined to be exactly the virtual file name(step 724). If the rule action is “ignore” or the rule action is“redirect”, a request to create the literal file using the determinedliteral file name is passed to the operating system 210 and the resultfrom the operating system 210 is returned to the requester (step 724).For example, a request to create a virtual file named “file_1” mayresult in the creation of a literal file named “Different_file_1.” Inone embodiment, this is accomplished by calling the original version ofthe hooked function and passing the formed literal name to the functionas an argument (step 724). For embodiments using a file system filterdriver, the first request to open the file using the virtual nameresults in a “STATUS_REPARSE” request response that indicates thedetermined literal name. The I/O Manager then reissues the file openrequest with the determined literal name include in the STATUS_REPARSEresponse.

If the rule action determined in step 720 is not “ignore” or “redirect”but is “isolate,” then the literal file name is identified as theinstance of the virtual file name in the user scope. If the literal filealready exists, but is associated with metadata indicating that it is aplaceholder or that it is deleted, then the associated metadata ismodified to remove those indications, and it is ensured that the file isempty.

In some embodiments, small amounts of metadata about a file may bestored directly in the literal filename, such as by suffixing thevirtual name with a metadata indicator, where a metadata indicator is astring uniquely associated with a particular metadata state. Themetadata indicator may indicate or encode one or several bits ofmetadata. Requests to access the file by virtual filename check forpossible variations of the literal filename due to the presence of ametadata indicator, and requests to retrieve the name of the file itselfare hooked or intercepted in order to respond with the literal name. Inother embodiments, one or more alternate names for the file may beformed from the virtual file name and a metadata indicator, and may becreated using hard link or soft link facilities provided by the filesystem. The existence of these links may be hidden from applications bythe isolation environment 260 by indicating that the file is not foundif a request is given to access a file using the name of a link. Aparticular link's presence or absence may indicate one bit of metadatafor each metadata indicator, or there may be a link with a metadataindicator that can take on multiple states to indicate several bits ofmetadata. In still other embodiments, where the file system supportsalternate file streams, an alternate file stream may be created toembody metadata, with the size of the stream indicating several bits ofmetadata. In still other embodiments, a file system may directly providethe ability to store some third party metadata for each file in the filesystem.

In specific ones of these embodiments, a list of deleted files or filesystem elements may be maintained and consulted to optimize this checkfor deleted files. In these embodiments, if a deleted file is recreatedthen the file name may be removed from the list of deleted files. Inothers of these embodiments, a file name may be removed from the list ifthe list grows beyond a certain size.

In either case, a request to open the user-scope literal file is passedto the operating system 210 (step 726). In some embodiments, rules mayspecify that the literal file corresponding to the virtual file shouldbe created in a scope other than the user scope, such as theinstallation scope, the system scope, a user sub-scope or aninstallation sub-scope.

If the literal file was opened successfully (step 728), the literal fileis returned to the requester (step 730). If on the other hand, in step728, the requested file fails to open, placeholders are created for eachancestor of the literal file that does not currently exist in the userscope (step 732) and a request to create the literal file using theliteral name is passed to the operating system 210 and the result isreturned to the requestor (step 734). This embodiment is for operatingsystems 210 with APIs or facilities that only support creation of onelevel per call invocation. Extension to multi-levels per call invocationshould be obvious to one skilled in the art.

In some file systems, both short and long filenames may be given to eachfile. Either name may be used to access the file in any of the fileoperations described above. For each file that possesses both a shortand long filename, this implicitly creates an association between theshort and long filename assigned to that file. In some of these filesystems, short names are automatically assigned by the file system tofiles that are created using long file names. If the association betweenshort and long filename is not maintained by the isolation environment260, files with different long names in the same directory but indifferent scope levels may have the same short file name, leading toambiguity if the short name is used to access a virtual file.Alternately, the short file name may change when a file is copied to auser scope for modification meaning the virtual file can no longer beaccessed using the original short name.

In order to prevent these issues, firstly file system operations thatcopy file instances opened with intention to modify to a “higher” scopepreserve the association between the short and long filenames associatedwith the copied instance. Secondly, unique short names are created fornewly-created isolated files in lieu of the filenames assigned by theoperating system. The generated short filenames should satisfy thecondition that the generated filenames do not match any existing shortfilenames in the same directory in the same scope or in the samedirectory in a “lower” scope. For example, a short filename generatedfor an instance of a file located in a user scope should not matchexisting short filenames in installation-scope instance of the directoryor in the system-scope instance of the directory.

Referring now to FIG. 11A, one embodiment of the steps taken to assignunique short filenames after creating a new file is shown. In briefoverview, a check is made to determine if short filenames should begenerated (step 752). If not, a status is returned indicating that noshort filename is generated (step 758). Otherwise, the filename ischecked to determine if it is already a legal short filename accordingto the file system (step 754). If it is already a legal short filename,a status is returned indicating that no short name is generated (step756). Otherwise, a suitable short filename is constructed (step 756).

Still referring to FIG. 11A, and in greater detail, a check is made todetermine if short filenames should be generated (step 752). In someembodiments, this decision may be made based on the device storing thefile to which the filename refers. In other embodiments, generation ofshort filenames may be enabled for certain scopes or sub-scopes, or forthe isolation environment 260 as a whole. In some of these embodiments,a registry setting may specify whether a short filename is generated fora particular filename. If no short filename should be generated, astatus that no short filename is generated is returned (step 758).

Otherwise, the filename is checked to determine if it is already a legalshort filename (step 754). In some embodiments, legal short filenamescontain up to eight characters in the filename and up to threecharacters in an optional extension. In some embodiments, legal shortnames contain only legal characters, such as A-Z, a-z, 0-9, ', ˜, !, @,#, $, %, ^, &, *, (,), -, _, ‘, {, and }. In some embodiments a leadingspace or “.” or more than one embedded “.” is illegal. If the providedfilename is already a legal short filename, a status is returned that noshort filename is generated (step 758).

Otherwise, if it is determined in step 754 that the filename is anillegal short filename, a suitable short filename is constructed (step756). In some embodiments this is achieved by using some of the parts ofthe long filename that are legal to use in a short filename, combinedwith an encoded iteration count to form a candidate short filename. Theiteration count is increased until the associated candidate shortfilename is suitable, that is it is a legal short filename that is notused by any other file in the same directory in the same scope, or inthe same directory in a lower scope. In other embodiments, the longfilename is mangled or hashed and encoded, and is combined with anencoded iteration count to form a candidate short filename. Theiteration count is increased until the associated candidate shortfilename is suitable, that is it is a legal short filename that is notused by any other file in the same directory in the same scope, or inthe same directory in a lower scope. In all of these embodiments ascope-specific string may be incorporated into the candidate shortfilename to increase the likelihood that a suitable candidate shortfilename is found with a low iteration count.

Illustrated in FIG. 12 is one embodiment of the subroutine 614 called inthe process illustrated in FIG. 8. This subroutine is a method, executedwithin the method 601 depicted in FIG. 8, to cycle through the one ormore installation scopes included in the isolation environment 260. Whenthe existence of a user-scope candidate file is determined in step 612of the method 601 in FIG. 8 to have a neutral existence, the subroutine614 is called and a candidate file is identified in the firstinstallation scope (step 1724). It is then determined whether or not acandidate file was in fact found in the first installation scope (step1702). If a candidate file is found then a check is done as to whetheror not this found candidate file has a negative existence indicatingthat that found file has been marked for deletion or is otherwise nolonger present in the installation scope (step 1704). When the candidatehas a negative existence, a check is the done to determine if there aremore installation scopes within the isolation environment 260 (step1710), however if the candidate file does not have a negative existence,then a check is done to determine if the candidate file has a neutralexistence (step 1706). When the candidate file has a neutral existencethis indicates that the file may be a placeholder or that the file maynot exist, and so the isolation scope 260 is further analyzed todetermine if there are additional installation scopes present in theisolation environment 260 (step 1710). If the candidate file does nothave a neutral existence, then a value is returned to the main method601 indicating that the candidate file has a positive existence (step1708). If after step 1724, it is determined that a candidate file wasnot found (step 1702), then the isolation environment 260 is analyzed todetermine if there are additional installation scopes in the isolationenvironment 260 (step 1710). When it is determined that there areadditional installation scopes present, a second candidate file isidentified in the next installation scope (step 1712). Once the nextinstallation scope is analyzed, it is determined whether or not acandidate file was found in that installation scope (step 1714). When acandidate file is found, that file is then checked to determine whetheror not is has a negative existence (step 1704), or a neutral existence(step 1706). If a second candidate file is not found, then a check isdone as to whether or not there are additional installation scopes (step1710). When no more additional installation scopes are identified (step1710), a check is done as to whether a candidate file was found duringthe last check (step 1724, step 1712), and if no file is found, anegative value is returned to the main method 601 (step 1722). If acandidate file is found (step 1716), then it is determined whether ornot the found candidate file has a neutral existence (step 1718). Whenthe candidate file has a neutral existence, a neutral value is returnedto the main method 601 (step 1720), and when the candidate file does nothave a neutral existence, a negative value is returned to the mainmethod 601 (step 1722).

Further referring to FIG. 12 in more detail, in one embodiment of thesubroutine 614, a candidate file is identified in the first installationscope (step 1724). Other embodiments may include a subroutine 614 thatchecks for the candidate file in the last installation scope or inanother installation scope where the location of the installation scopeis either a user-defined value or a pre-determined value. Still furtherembodiments include a subroutine 614 where the first installation scopeis the installation scope is the highest priority installation scopewithin the isolation environment 260. Embodiments of the subroutine 614may include a first installation scope that is the lowest priorityinstallation scope within the isolation environment 260, a firstinstallation scope that has the highest priority within a sub-scope ofinstallation scopes, or a first installation scope that has the lowestpriority within a sub-scope of installation scopes. It is thendetermined whether or not a candidate file was found in the firstinstallation scope (step 1702). In one embodiment of the process 614,when a candidate file is found in the first installation scope,determinations are made as to whether the file has a negative existence(step 1704), a neutral existence (step 1706), or a positive existence(step 1708). When a file has a negative existence, furtherdeterminations are made as to whether or not there are additionalinstallation scopes (step 1710), if there are no other installationscopes then a verification is made that a candidate file was found (step1716) and a determination is made as to whether or not the candidatefile is neutral (step 1718) or negative (step 1722). When a file doesnot have a negative existence, a determination is made as to whether thefile has a neutral existence (step 1706), and if the candidate file doesnot have a neutral existence (step 1706), then a positive valueindicating a candidate file with a positive existence is returned to themain process 601 (step 1708). If a file has a neutral existence then acheck is done as to whether or not additional installation scopes areincluded in the isolation environment 260 (step 1710), if there are noother installation scopes then a verification is made that a candidatefile was found (step 1716) and a determination is made as to whether ornot the candidate file is neutral (step 1718) or negative (step 1722).

In one embodiment, when a candidate file is not found in the firstinstallation scope, a determination is made as to whether or not thereexist additional installation scopes within the isolation environment260 (step 1710). Other embodiments may be configured to search through apre-determined number of installation scopes. When additionalinstallation scopes exist, a next installation scope is searched toidentify a candidate file (step 1712). In one embodiment, the nextinstallation scope is the installation scope that is one priority levelless than the priority level of the previously checked installationscope. For example, in this embodiment if the previously checkinstallation scope was the first installation scope with the highestpriority, then the next installation scope would be the installationscope with the second highest priority. When additional installationscopes do not exist, a determination is made as to whether or not acandidate file was previously identified (step 1716). In one embodiment,a previously identified candidate file would include files identified bythe method 614 before a check was made as to the existence of additionalinstallation scopes.

When additional installation scopes are included within the isolationenvironment 260, the method attempts to identify a candidate file ineach installation scope (1712). In one embodiment, a determination ismade as to whether or not a candidate file was found (step 1714), and ifa candidate file was found, the file is then analyzed to determine ifthe file has a negative existence (step 1704), a neutral existence (step1706), or a positive existence (step 1708). When a candidate file is notfound (1714), then a check is made for more installation scopes (step1710), and if there are no additional installation scopes, it isverified that a candidate file was found (step 1716). If a candidatefile was not found, a negative value is returned (step 1722), and if acandidate file is found, then a determination is made as to whether thecandidate file is neutral (step 1718).

Illustrated in FIG. 13 is one embodiment of a subroutine 776 called bythe method 798 in FIG. 10. In one embodiment, a subroutine 776 is calledby the process 798 in FIG. 10 to cycle through all installation scopesincluded in the isolation environment 260, and identify an installationscope with a positive existence. After storing the enumerated systemscope results in a working data store (step 774), a first installationscope candidate is identified (1742). A determination is made as towhether or not the first installation scope candidate has a negativeexistence (1744). When the first installation scope has a positiveexistence, a positive value is returned to the main process 798 (step1746), and the installation scope is enumerated into the working datastore (step 782). When the first installation scope has a negativeexistence, a check is made for the existence of additional installationscopes within the isolation environment (step 1748). If there are noadditional installation scopes, then a negative value is returned to themain process 798 (step 1754). If there are additional installationscopes, then a next candidate installation scope is identified (step1750) and a determination is made as to whether or not the nextinstallation scope has a negative existence (step 1744). A verificationis made as to whether or not the next candidate installation scope

Referring to FIG. 13 in more detail, when the subroutine 776 is calledfrom the main process 798, an embodiment of which is illustrated in FIG.10, a first installation scope candidate is identified (step 1742). Inone embodiment, the first installation scope candidate is theinstallation scope that has a higher priority than all otherinstallation scopes included in the isolation environment 260. Otherembodiments may include a first installation scope candidate that is theinstallation scope that has a lower priority than all other installationscopes included in the isolation environment 260. Still otherembodiments may include a first installation sub-scope that has a higherpriority than the other installation sub-scopes, or a first installationscope that has a higher priority than the other installation scopesincluded in a sub-isolation environment 260.

An embodiment of the process 776 makes a determination as to whether ornot the installation scope has a negative existence (step 1744). In oneembodiment, when the installation scope does have a negative existence(step 1744), a check is made to determine whether or not the isolationenvironment 260 includes additional installation scopes (step 1748). Inanother embodiment, when the installation scope does not have a negativeexistence (step 1744), a positive value is returned to the main process798 (step 1746).

One embodiment of the method 776 determines whether or not there existadditional installation scopes within the isolation environment 260(step 1748). In one embodiment, when there exist no additionalinstallation scopes, a negative value is returned to the main process798 (step 1746), while in another embodiment a next installation scopecandidate is identified (step 1750) when there exist additionalinstallation scopes within the isolation environment 260.

Registry Virtualization

The methods and apparatus described above may be used to virtualizeaccess to a registry database. As described above a registry databasestores information regarding hardware physically attached to thecomputer 200, which system options have been selected, how computermemory is set up, various items of application-specific data, and whatapplication programs should be present when the operating system 210 isstarted. A registry database 220 is commonly organized in a logicalhierarchy of “keys” which are containers for registry values.

In brief overview, FIG. 14 depicts one embodiment of the steps taken toopen a registry key in the isolation environment 260 described above. Arequest to open a registry key is received or intercepted, the requestcontaining a registry key name which is treated as a virtual key name bythe isolation environment 260 (step 802). A processing rule applicableto the virtual name in the request determines how the registry keyoperation is processed (step 804). If the rule action is “redirect”(step 806), the virtual key name provided in the request is mapped to aliteral key name as specified by the applicable rule (step 808). Arequest to open the literal registry key using the literal key name ispassed to the operating system 210 and the result from the operatingsystem 210 is returned to the requester (step 810). If the rule actionis not “redirect”, but is “ignore” (step 806), then the virtual key nameis identified as the literal key name (step 812), and a request to openthe literal registry key is passed to the operating system 210 and theresult from the operating system 210 is returned to the requester (step810). If the rule action determined in step 806 is not “redirect” and isnot “ignore,” but is “isolate”, the virtual key name provided in therequest is mapped to a user-scope candidate key name, that is a key namecorresponding to the virtual key name that is specific to the applicableuser scope (step 814). The category of existence of the user-scopecandidate key is determined by examining the user scope and any metadataassociated with the candidate key (step 816). If the candidate key isdetermined to have “negative existence”, because either the candidatekey or one of its ancestor keys in the user scope is marked as deleted,this means the requested virtual key is known to not exist. In thiscase, an error condition indicating the requested file is not found isreturned to the requester (step 822). If instead in step 816 thecandidate key is determined to have “positive existence”, because thecandidate key exists in the user scope and is not marked as aplaceholder node, then the requested virtual key is known to exist. Thecandidate key is identified as the literal key for the request (step818), and a request issued to open the literal key and the resultreturned to the requester (step 820). If, however, in step 816, thecandidate key has “neutral existence” because the candidate key does notexist, or the candidate key exists but is marked as a placeholder node,it is not yet known whether the virtual key exists or not. In this casea call is made to a subroutine that identifies an installation-scope keyname corresponding to the virtual key name as the candidate key name,and further verifies the category of existence of the candidate key(step 824). In other words, this subroutine creates a candidate key nameby mapping the virtual key name to the corresponding native key namespecific to the applicable installation scope, and determines thecategory of existence of the candidate key by examining the installationscope and any metadata associated with the candidate key (step 824). Thesubroutine returns a value to the main method 811 indicating thecategory of existence of the candidate key. If the returned value is a“negative existence”, then either the candidate key or one of itsancestor keys in the installation scope is marked as deleted, this meansthe requested virtual key is known to not exist. In this case, an errorcondition indicating the requested key is not found is returned to therequester (step 822). If instead in step 826 the candidate key isdetermined to have “positive existence”, because the candidate keyexists in the installation scope and is not marked as a placeholdernode, then the requested virtual key is known to exist. The request ischecked to determine if the open request indicates an intention tomodify the key (step 828). If not, the candidate key is identified asthe literal key for the request (step 818), and a request issued to openthe literal key and the result returned to the requester (step 820). If,however, in step 828, it is determined that the open request indicatesan intention to modify the key, permission data associated with the keyis checked to determine if modification of the key is allowed (step836). If not, an error condition is returned to the requester (step 838)indicating that modification of the key is not allowed. If thepermission data indicates that the key may be modified, the candidatekey is copied to the user scope (step 840). In some embodiments, thecandidate key is copied to a location defined by the rules engine. Forexample, a rule may specify that the key is copied to an installationscope. In other embodiments the rules may specify a particularinstallation sub-scope or user sub-scope to which the key should becopied. Any ancestors of the requested key that do not appear in thescope to which the key is copied are created as placeholders in thescope in order to correctly locate the copied instance in the hierarchy.The newly copied scoped instance is identified as the literal key (step842) and a request issued to open the literal key and the resultreturned to the requester (step 820). Returning to step 826, if thecandidate key has neutral existence because the candidate key does notexist, or because the candidate key is found but marked as a placeholdernode, it is not yet known whether the virtual key exists or not. In thiscase, the system-scope key name corresponding to the virtual key name isidentified as the candidate key name (step 830). In other words, thecandidate key name is exactly the virtual key name. If the candidate keydoes not exist (step 832), an error condition indicating the virtual keywas not found is returned to the requester (step 834). If on the otherhand the candidate key exists (step 832), the request is checked todetermine if the open request indicates an intention to modify the key(step 828). If not, the candidate key is identified as the literal keyfor the request (step 818), and a request issued to open the literal keyand the result returned to the requester (step 820). If, however, instep 828, it is determined that the open request indicates intention tomodify the key, permission data associated with the key is checked todetermine if modification of the key is allowed (step 836). If not, anerror condition is returned to the requester (step 838) indicating thatmodification of the key is not allowed. If the permission data indicatesthat the key may be modified, the candidate key is copied to the userscope (step 840). In some embodiments, the candidate key is copied to alocation defined by the rules engine. For example, a rule may specifythat the key is copied to an installation scope. In other embodimentsthe rules may specify a particular installation sub-scope or usersub-scope to which the key should be copied. Any ancestors of therequested key that do not appear in the scope are created asplaceholders in the scope in order to correctly locate the copiedinstance in the hierarchy. The newly copied scoped instance isidentified as the literal key (step 842) and a request issued to openthe literal key and the result returned to the requestor (step 820).

Still referring to FIG. 14 and now in more detail, a request to open avirtual registry key is received or intercepted (step 802). Thecorresponding literal registry key may be of user scope, installationscope or system scope, or it may be scoped to an installation sub-scopeor a user sub-scope. In some embodiments, the request is hooked by afunction that replaces the operating system 210 function or functionsfor opening a registry key. In another embodiment a hookingdynamically-linked library is used to intercept the request. The hookingfunction may execute in user mode or in kernel mode. For embodiments inwhich the hooking function executes in user mode, the hooking functionmay be loaded into the address space of a process when that process iscreated. For embodiments in which the hooking function executes inkernel mode, the hooking function may be associated with an operatingsystem resource that is used in dispatching requests for native registrykeys. For embodiments in which a separate operating system 210 functionis provided for each type of registry key operation, each function maybe hooked separately. Alternatively, a single hooking function may beprovided which intercepts create or open calls for several types ofregistry key operations.

The request contains a registry key name, which is treated as a virtualregistry key name by the isolation environment 260. The processing ruleapplicable to the registry key open request is determined (step 804) byconsulting the rules engine. In some embodiments, the rules engine maybe provided as a relational database. In other embodiments, the rulesengine may be a tree-structured database, a hash table, or a flat filedatabase. In some embodiments, the virtual registry key name providedfor the requested registry key is used to locate in the rule engine arule that applies to the request. In particular ones of theseembodiments, multiple rules may exist in the rules engine for aparticular registry key and, in these embodiments, the rule having thelongest prefix match with the virtual registry key name is the ruleapplied to the request. In other embodiments, a process identifier isused to locate in the rule engine a rule that applies to the request, ifone exists. The rule associated with a request may be to ignore therequest, redirect the request, or isolate the request. Although shown inFIG. 14 as a single database transaction or single lookup into a file,the rule lookup may be performed as a series of rule lookups.

If the rule action is “redirect” (step 806), the virtual registry keyname provided in the request is mapped to the literal registry key nameaccording to the applicable rule (step 808). A request to open theliteral registry key using the literal registry key name is passed tothe operating system 210 and the result from the operating system 210 isreturned to the requester (step 810). For example, a request to open aregistry key named “registry_key_1” may result in the opening of aliteral registry key named “Different_registry_key_1”. In oneembodiment, this is accomplished by calling the original version of thehooked function and passing the formed literal name to the function asan argument. In other embodiments, a registry filter driver facilityconceptually similar to a file system filter driver facility may beprovided by the operating system 210. In these embodiments, opening theliteral registry key may be achieved by responding to the originalrequest to open the virtual key by signaling to the registry filtermanager to reparse the request using the determined literal key name. Ifinstead the rule action is “ignore” (step 806), then the literalregistry key name is determined to be exactly the virtual registry keyname (step 812), and the request to open the literal registry key ispassed to the operating system and the result from the operating systemis returned to the requester (step 810). For example, a request to opena registry key named “registry_key_1” results in the opening of aliteral registry key named “registry_key_1”. In one embodiment, this isaccomplished by calling the original version of the hooked function andpassing the formed literal name to the function as an argument. Inanother embodiment, this is accomplished by signaling to the registryfilter manager to continue processing the original unmodified request inthe normal fashion.

If in step 806 the rule action is “isolate”, then the user-scoperegistry key name corresponding to the virtual registry key name isidentified as the candidate registry key name (step 814). In otherwords, the candidate registry key name is formed by mapping the virtualregistry key name to the corresponding native registry key name specificto the applicable user scope. For example, a request to open a registrykey named “registry_key_1” may result in the opening of a literalregistry key named “Isolated_UserScope_UserA_registry_key_1”. In oneembodiment, this is accomplished by calling the original version of thehooked function and passing the formed literal name to the function asan argument. In other embodiments, opening the literal registry key maybe achieved by responding to the original request to open the virtualkey by signaling to the registry filter manager to reparse the requestusing the determined literal key name.

In some embodiments, the literal name formed in order to isolate arequested virtual registry key may be based on the virtual registry keyname received and a scope-specific identifier. The scope-specificidentifier may be an identifier associated with an installation scope, auser scope, a session scope, an installation sub-scope, a usersub-scope, or some combination of the above. The scope-specificidentifier is used to “mangle” the virtual name received in the request.

In other embodiments, the user scope or a sub-scope may be a registrykey under which all keys that exist in the user scope are stored. Insome of these embodiments, the key hierarchy under the user scope keyreflects the path of the requested resource. In other words, the literalkey path is formed by mapping the virtual key path to the user scope.For example, if the requested key is HKLM\Software\Citrix\MyKey and theuser scope key is HKCU\Software\UserScope\, then the path to theuser-scope literal key may beHKCU\Software\UserScope\HKLM\Software\Citrix\MyKey. In otherembodiments, the path to the user-scope literal may be defined in anative naming convention. For example, the path to the user-scopeliteral key may beHKCU\Software\UserScope\Registry\Machine\Software\Citrix\MyKey. In stillother embodiments, the user-scope keys may all be stored under a singlekey with names chosen to be unique and a database may be used to storethe mapping between the requested key name and the name of thecorresponding literal key stored in the user key. In still otherembodiments, the contents of the literal keys may be stored in adatabase or a file store.

The category of existence of the candidate key is determined byexamining the user scope and any metadata associated with the candidatekey (step 816). If the candidate key is determined to have “negativeexistence”, because either the candidate key or one of its ancestor keysin the user scope is marked as deleted, this means the requested virtualkey is known to not exist. In this case, an error condition indicatingthe requested key is not found is returned to the requester (step 822).

In some embodiments, the literal registry key may be associated withmetadata indicating that the virtualized registry key has already beendeleted. In some embodiments, metadata about a registry key may bestored in a distinguished value held by that key, with the existence ofthat value hidden from ordinary application usage of registry APIs. Insome embodiments, small amounts of metadata about a registry key may bestored directly in the literal key name, such as by suffixing thevirtual name with a metadata indicator, where a metadata indicator is astring uniquely associated with a particular metadata state. Themetadata indicator may indicate or encode one or several bits ofmetadata. Requests to access the key by virtual name check for possiblevariations of the literal key name due to the presence of a metadataindicator, and requests to retrieve the name of the key itself arehooked or intercepted in order to respond with the literal name. Inother embodiments, the metadata indicator may be encoded in a sub-keyname or a registry value name instead of the key name itself. In stillother embodiments, a registry key system may directly provide theability to store some 3rd party metadata for each key. In someembodiments, metadata is stored in a database or other repositoryseparate from the registry database. In some embodiments, a separatesub-scope may be used to store keys that are marked as deleted. Theexistence of a key in the sub-scope indicates that the key is marked asdeleted.

In specific ones of these embodiments, a list of deleted keys or keysystem elements may be maintained and consulted to optimize this checkfor deleted keys. In these embodiments, if a deleted key is recreatedthen the key name may be removed from the list of deleted keys. Inothers of these embodiments, a key name may be removed from the list ifthe list grows beyond a certain size.

If instead in step 816 the candidate key is determined to have “positiveexistence”, because the candidate key exists in the user scope and isnot marked as a placeholder node, then the requested virtual key isknown to exist. The candidate key is identified as the literal key forthe request (step 818), and a request issued to open the literal key andthe result returned to the requester (step 820).

If, however, in step 816, the candidate key has “neutral existence”because the candidate key does not exist, or the candidate key existsbut is marked as a placeholder node, it is not yet known whether thevirtual key exists or not.

In this case a subroutine is called to retrieve an installation-scopekey name corresponding to the virtual key name, identify foundinstallation-scope key names as candidate key names, and categorize theexistence of the identified candidate keys by examining the installationscopes and any metadata associated with the identified candidate keys(step 824). In one embodiment, the subroutine called is an embodiment ofthe subroutine depicted in FIG. 18. This subroutine searches through theone or more installation scopes included in the isolation environment260 to determine whether or not the candidate key name exists within theone or more installation scopes. In other words, the candidate key nameis formed by mapping the virtual key name to the corresponding nativekey name specific to the applicable installation scope. In oneembodiment of the subroutine, a value is returned by the subroutineindicating the category of existence of the candidate key as determinedby examining the installation scopes and any metadata associated withthe candidate key (step 824).

If the installation-scope candidate key is determined to have “negativeexistence”, because either the candidate key or one of its ancestor keysin the installation scope is marked as deleted, this means the requestedvirtual key is known to not exist. In this case, an error conditionindicating the requested key is not found is returned to the requester(step 822).

If, however, in step 824 the candidate key is determined to have“positive existence”, because the candidate key exists in theinstallation scope and is not marked as a placeholder node, then therequested virtual key is known to exist. The request is checked todetermine if the open request indicates an intention to modify the key(step 828). If not, the candidate key is identified as the literal keyfor the request (step 818), and a request issued to open the literal keyand the result returned to the requestor (step 820).

If, however, in step 828, it is determined that the open requestindicates intention to modify the key, permission data associated withthe key is checked to determine if modification of the key is allowed(step 836). In some embodiments, the permission data is associated withthe installation-scope candidate key. In some of these embodiments, thepermissions data is stored in a rules engine or in metadata associatedwith the candidate key. In other embodiments, the permission dataassociated with the candidate key is provided by the operating system210. Further, the rules engine may include configuration settingsinstructing the isolation environment 260 to obey or override the nativepermission data for virtualized copies of resources. In someembodiments, the rules may specify for some virtual resources the scopein which modifications are to occur, for example the system scope or theinstallation scope or a sub-scope, or the user scope or a sub-scope. Insome embodiments, the rules engine may specify configuration settingsthat apply to subsets of the virtualized native resources based onhierarchy. In some of these embodiments, the configuration settings maybe specific to each atomic native resource.

If the permission data associated with the candidate key indicates thatit may not be modified, an error condition is returned to the requester(step 838) indicating that modification of the key is not allowed. Ifthe permission data indicates that the key may be modified, thecandidate key is copied to the user scope (step 840). In someembodiments, the candidate key is copied to a location defined by therules engine. For example, a rule may specify that the key is copied toanother installation scope. In other embodiments the rules may specify aparticular installation sub-scope or user sub-scope to which the keyshould be copied. Any ancestors of the requested key that do not appearin the scope to which the key is copied are created as placeholders inthe scope in order to correctly locate the copied instance in thehierarchy.

In some embodiments, metadata is associated with keys copied to thescope that identifies the date and time at which the keys were copied.This information may be used to compare the time stamp associated withthe copied instance of the key to the time stamp of the lastmodification of the original instance of the key or of another instanceof the key located in a lower isolation scope. In these embodiments, ifthe original instance of the key, or an instance of the key located in alower scope, is associated with a time stamp that is later than the timestamp of the copied key, that key may be copied to the scope to updatethe candidate key. In other embodiments, the copy of the key in thescope may be associated with metadata identifying the scope containingthe original key that was copied.

In further embodiments, keys that are copied to scopes because they havebeen opened with intent to modify them may be monitored to determine ifthey are, in fact, modified. In one embodiment a copied key may beassociated with a flag that is set when the key is actually modified. Inthese embodiments, if a copied key is not actually modified, it may beremoved from the scope to which it was copied after it is closed, aswell as any placeholder nodes associated with the copied key.

The scoped instance is identified as the literal key (step 842) and arequest issued to open the literal key and the result returned to therequestor (step 820).

Returning to step 826, if the candidate key has neutral existencebecause the candidate key does not exist, or if the candidate key isfound but marked as a placeholder node, it is not yet known whether thevirtual key exists or not. In this case, the system-scope key namecorresponding to the virtual key name is identified as the candidate keyname (step 830). In other words, the candidate key name is exactly thevirtual key name.

If the candidate key does not exist (step 832), an error conditionindicating the virtual key was not found is returned to the requester(step 834). If on the other hand the candidate key exists (step 832),the request is checked to determine if the open request indicates anintention to modify the key (step 828).

As above, if the candidate key is being opened without the intent tomodify it, the system-scope candidate key is identified as the literalkey for the request (step 818), and a request issued to open the literalkey and the result returned to the requester (step 820). If, however, instep 828, it is determined that the open request indicates intention tomodify the key, permission data associated with the key is checked todetermine if modification of the key is allowed (step 836). In someembodiments, the permission data is associated with theinstallation-scope candidate key. In some of these embodiments, thepermissions data is stored in a rules engine or in metadata associatedwith the candidate key. In other embodiments, the permission dataassociated with the candidate key is provided by the operating system210. Further, the rules engine may include configuration settingsinstructing the isolation environment 260 to obey or override the nativepermission data for virtualized copies of resources. In someembodiments, the rules may specify for some virtual resources the scopein which modifications are to occur, for example the system scope or theinstallation scope or a sub-scope, or the user scope or a sub-scope. Insome embodiments, the rules engine may specify configuration settingsthat apply to subsets of the virtualized native resources based onhierarchy. In some of these embodiments, the configuration settings maybe specific to each atomic native resource.

If the permission data associated with the system-scope candidate keyindicates that the key may not be modified, an error condition isreturned to the requester (step 838) indicating that modification of thekey is not allowed. If, however, the permission data indicates that thekey may be modified, the candidate key is copied to the user scope (step840). In some embodiments, the candidate key is copied to a locationdefined by the rules engine. For example, a rule may specify that thekey is copied to an installation scope or that it may be left in thesystem scope. In other embodiments the rules may specify a particularinstallation sub-scope or user sub-scope to which the key should becopied. Any ancestors of the requested key that do not appear in thescope are created as placeholders in the scope in order to correctlylocate the copied instance in the hierarchy.

In some embodiments, metadata is associated with keys copied to thescope that identifies the date and time at which the keys were copied.This information may be used to compare the time stamp associated withthe copied instance of the key to the time stamp of the lastmodification of the original instance of the key. In these embodiments,if the original instance of the key is associated with a time stamp thatis later than the time stamp of the copied key, the original key may becopied to the scope to update the candidate key. In other embodiments,the candidate key copied to the scope may be associated with metadataidentifying the scope from which the original key was copied.

In further embodiments, keys that are copied to scopes because they havebeen opened with intent to modify them may be monitored to determine ifthey are, in fact, modified. In one embodiment a copied key may beassociated with a flag that is set when the key is actually modified. Inthese embodiments, if a copied key is not actually modified, when it isclosed it may be removed from the scope to which it was copied, as wellas any placeholder nodes associated with the copied key. In stillfurther embodiments, the key is only copied to the appropriate scopewhen the key is actually modified.

The scoped instance is identified as the literal key (step 842) and arequest issued to open the literal key and the result returned to therequestor (step 820).

Referring now to FIG. 15, and in brief overview, one embodiment of thesteps taken to delete a registry key is depicted. Before a key can bedeleted, the key is first opened with delete access (step 901). If thekey is not opened successfully, an error is returned (step 916). If thevirtual key is opened successfully, a request to delete a virtualizedregistry key is received or intercepted, the request including thehandle to the literal key corresponding to the virtual key (step 902). Arule determines how the registry key operation is processed (step 904).In addition to the rule applicable to the key to be deleted, any otherrules applicable to immediate sub-keys are examined (step 905). For eachrule applicable to an immediate sub-key found, an attempt is made toopen a virtual sub-key, with the virtual sub-key's name being specifiedby the name given in the rule found in step 905. If a sub-key with aname corresponding to one of the rules found in step 905 is openedsuccessfully (step 906), then the virtual key is considered to havesub-keys, which means it cannot be deleted, and an error returned (step907).

If, after all the virtual key names extracted in step 905 have beenattempted to be opened (step 906) and no virtual keys were found toexist, further examination is required. If the rule action is not“isolate”, but is “redirect”, or is “ignore” (step 908), a request todelete the literal registry key is passed to the operating system 210and the result from the operating system 210 is returned to therequestor (step 911). If however the rule action determined in step 908is “isolate” the aggregated virtualized registry key is consulted todetermine if it contains any virtual sub-keys (step 914). If thevirtualized key has virtual sub-keys, then the deletion cannot continue,and an error is returned indicating the key has not been deleted (step920). If the virtualized key does not have virtual sub-keys, then theliteral key corresponding to the virtual key is examined to determine ifit masks a scoped key with the same virtual name in another scope level(step 922). If the literal key corresponding to the virtual key does notmask a differently scoped key with the same virtual name, then theliteral key which corresponds to the virtual key is deleted, and theresult returned (step 926). If the literal key corresponding to thevirtual key masks a differently scoped key with the same virtual name,then the literal key corresponding to the virtual key is marked with avalue indicating that it is deleted, and a successful result returned tothe caller (step 924).

Still referring to FIG. 15, and in more detail, in order to delete akey, it is first opened with delete access (step 901). The request toopen the key with delete access includes the name of the key which istreated as a virtual name by the isolation environment 260. A fullvirtualized key open is performed as described above. If the virtualizedopen operation fails, an error is returned to the requester (step 916).If the virtualized open operation succeeds, the handle of the literalkey corresponding to the virtual key is returned to the requestor.Subsequently a request to delete the registry key which was opened instep 901 is received or intercepted (step 902). The opened literalregistry key may be of user scope, installation scope, system scope, orsome applicable sub-scope. In some embodiments, the delete request ishooked by a function that replaces the operating system 210 function orfunctions for deleting the registry key. In another embodiment a hookingdynamically-linked library is used to intercept the delete request. Thehooking function may execute in user mode or in kernel mode. Forembodiments in which the hooking function executes in user mode, thehooking function may be loaded into the address space of a process whenthat process is created. For embodiments in which the hooking functionexecutes in kernel mode, the hooking function may be associated with anoperating system 210 resource that is used in dispatching requests fornative registry keys. In other embodiments, a registry filter driverfacility conceptually similar to a file system filter driver facilitymay be provided by the operating system 210. A practitioner skilled inthe art may create a registry filter driver, to which the operatingsystem 210 passes requests to perform registry operations, thusproviding a mechanism to intercept registry operation requests. Forembodiments in which a separate operating system 210 function isprovided for each type of registry key function, each function may behooked separately. Alternatively, a single hooking function may beprovided which intercepts create or open calls for several types ofregistry key functions.

The delete request contains a literal key handle. The virtual key nameassociated with the handle is determined by querying the operatingsystem 210 for the literal name associated with the handle. The rulesengine is consulted to determine the virtual name associated with theliteral name, if any. A rule determining how the registry key operationis processed (step 904) is obtained by consulting the rules engine. Insome embodiments, the virtual key name of the virtual registry key to bedeleted is used to locate in the rule engine a rule that applies to therequest. In particular ones of these embodiments, multiple rules mayexist in the rules engine for a particular virtual registry key and, insome of these embodiments, the rule having the longest prefix match withthe virtual key name is the rule applied to the request. In someembodiments, the rules engine may be provided as a relational database.In other embodiments, the rules engine may be a tree-structureddatabase, a hash table, or a flat registry key database. In someembodiments, the virtual key name corresponding to the virtual keyhandle in the request is used as an index into a rules engine to locateone or more rules that apply to the request. In some embodiments, aprocess identifier is used to locate in the rule engine a rule thatapplies to the request, if one exists. The rule associated with arequest may be to ignore the request, redirect the request, or isolatethe request. The rule lookup may occur as a series of decisions, or therule lookup may occur as a single database transaction.

The virtual name of the key to be deleted is used to consult the rulesengine to locate the set of rules applicable to any immediate child keysof the virtual key to delete, but not applicable to the virtual key tobe deleted. This set of rules is located whether those child keys existor not (step 905). If this set of rules applicable to immediate childkeys is not empty, then the virtual name of each of these rules isextracted. An attempt is made to do a full virtualized open of each ofthe virtual child key names extracted, in turn (step 906). If any of thevirtual keys corresponding to any of these virtual names can be openedsuccessfully, then this means that a virtual sub-key exists. This meansthat the virtual key cannot be deleted, as it has a virtual child thatexists, and an error is returned (step 907). If after examining all ofthe set of rules applicable to immediate children of the virtual key(step 905), no virtual sub-keys are found to exist, the deletion cancontinue. For example, a key with virtual name “key_1” may have childrules applicable to “key1\subkey_1” and “key1\subkey_2”. In this step,an attempt is made to do a virtualized open of “key1\subkey_1” and“key1\subkey_2”. If either of these virtual sub-keys can be openedsuccessfully, then the deletion fails, and an error is returned (step907). Only if neither of these virtual sub-keys exists can the deletioncontinue.

If the rule action is not “isolate”, but is “redirect”, or is “ignore”(step 908), a request to delete the literal registry key using theliteral key handle is passed to the operating system 210 and the resultfrom the operating system is returned to the requestor (step 911). Thisrequest fails if the literal key contains literal sub-keys. In oneembodiment, the request to delete the literal registry key isaccomplished by calling the original version of the hooked function andpassing the literal key handle to the function as an argument. Inembodiments that make use of a registry filter driver, this isaccomplished by responding to the request with a completion status thatsignals the operating system to perform normal processing on therequest. In some embodiments, operating system permissions associatedwith the literal registry key may prevent its deletion. In theseembodiments, an error message is returned that the virtual registry keycould not be deleted.

If the rule action determined in step 908 is “isolate”, then theaggregated virtualized registry key is consulted to determine if itcontains any virtual sub-keys (step 914). If the requested virtualregistry key contains virtual sub-keys, then the virtual key cannot bedeleted, and an error is returned to the caller (step 920).

If the requested virtual registry key does not contain virtual sub-keys,then the virtual key can be deleted. The action taken next depends onthe scope that contains the literal key to be deleted. For example, arequest to delete a virtual registry key may result in the deletion ofan application-scoped literal key. The scope containing the literal keycan be determined by consulting the rules engine with the full path tothe literal key.

If the literal key to be deleted is found in a particular scope, andthat literal key masks another key of the same virtual name in anotherscope, then the literal key to be deleted is marked as deleted, and aresult returned to the requester (step 924). For example, a virtual keythat corresponds to a user-scoped literal key is considered to mask adifferently-scoped key if a corresponding application-scoped key withthe same virtual name or a corresponding system-scoped key with the samevirtual name has “positive existence”, that is, exists in the scope, andis not marked as a placeholder, and is not considered to be deleted.Similarly, an application-scoped key is considered to mask asystem-scoped key corresponding to the same virtual name if thatsystem-scoped key exists and is not considered to be deleted.

If the literal key to be deleted is found not to mask another key of thesame virtual name in another scope, then the literal key to be deletedis actually deleted and a result returned (step 926).

In some embodiments, operating system permissions associated with theliteral registry key may prevent deletion of the literal registry key.In these embodiments, an error message is returned that the virtualregistry key could not be deleted.

In some embodiments, the literal registry key may be associated withmetadata indicating that the virtualized registry key has already beendeleted. In some embodiments, metadata about a registry key may bestored in a distinguished value held by that key, with the existence ofthat value hidden from ordinary application usage of registry APIs. Insome embodiments, small amounts of metadata about a registry key may bestored directly in the literal key name, such as by suffixing thevirtual name with a metadata indicator, where a metadata indicator is astring uniquely associated with a particular metadata state. Themetadata indicator may indicate or encode one or several bits ofmetadata. Requests to access the key by virtual name check for possiblevariations of the literal key name due to the presence of a metadataindicator, and requests to retrieve the name of the key itself arehooked or intercepted in order to respond with the literal name. Inother embodiments, the metadata indicator may be encoded in a sub-keyname or a registry value name instead of the key name itself. In stillother embodiments, a registry key system may directly provide theability to store some 3rd party metadata for each key. In someembodiments, metadata could be stored in a database or other repositoryseparate from the registry database. In some embodiments, a separatesub-scope may be used to store keys that are marked as deleted. Theexistence of a key in the sub-scope indicates that the key is marked asdeleted.

In specific ones of these embodiments, a list of deleted keys or keysystem elements may be maintained and consulted to optimize this checkfor deleted keys. In these embodiments, if a deleted key is recreatedthen the key name may be removed from the list of deleted keys. Inothers of these embodiments, a key name may be removed from the list ifthe list grows beyond a certain size.

In some embodiments, an ancestor of the literal registry key in the samescope is associated with metadata indicating that it is deleted, or isotherwise indicated to be deleted. In these embodiments, an errormessage may be returned indicating that the virtualized registry keydoes not exist. In specific ones of these embodiments, a list of deletedregistry keys or registry key system elements may be maintained andconsulted to optimize this check for deleted registry keys.

Referring now to FIG. 16, and in brief overview, one embodiment of aprocess 1003 for enumerating a key in the described virtualizedenvironment is shown. Before a key can be enumerated, the key is firstopened with enumerate access (step 1001). If the key is not openedsuccessfully, an error is returned (step 1040). If the virtual key isopened successfully, a request to enumerate is received or intercepted,the request including the handle to the literal key corresponding to thevirtual key (step 1002).

The virtual key name corresponding to the handle is determined, and therules engine is consulted to determine the rule for the key specified inthe enumerate request (step 1004). If the rule doesn't specify an actionof “isolate”, but instead specifies “ignore” or specifies “redirect”(step 1006), the literal key identified by the literal key handle isenumerated, and the enumeration results stored in a working data store(step 1012), followed by step 1030 as described later.

If, however, the rule action specifies “isolate,” firstly the systemscope is enumerated; that is, the candidate key name is exactly thevirtual key name, and if the candidate key exists it is enumerated. Theenumeration results are stored in a working data store. If the candidatekey does not exist, the working data store remains empty at this stage(step 1014). Next a subroutine is called to cycle through theinstallation scopes to identify a candidate key and verify the categoryof existence of the candidate key (step 1015). In some embodiments, thesubroutine called is the subroutine illustrated in FIG. 19. In otherembodiments, the subroutine returns a value indicative of the categoryof existence of the candidate key (step 1015). If the candidate key has“negative existence”, i.e. it or one of its ancestors in the scope ismarked as deleted, then within this scope it is known to be deleted, andthis is indicated by flushing the working data store (step 1042). Ifinstead the candidate key does not have negative existence, thecandidate key is enumerated and any enumeration results obtained aremerged into the working data store. In particular, for each sub-key inthe enumeration, its category of existence is determined. Sub-keys withnegative existence are removed from the working data store, and sub-keyswith positive existence, i.e. those that exist and are not marked asplaceholders and are not marked as deleted, are added to the workingdata store, replacing the corresponding sub-key if one is alreadypresent in the working data store (step 1016).

In either case, the candidate key is identified as the user-scopeinstance of the virtual key, and the category of existence of thecandidate key is determined (step 1017). If the candidate key has“negative existence”, i.e. it or one of its ancestors in the scope ismarked as deleted, then within this scope it is known to be deleted, andthis is indicated by flushing the working data store (step 1044). Ifinstead the candidate key does not have negative existence, thecandidate key is enumerated and any enumeration results obtained aremerged into the working data store. In particular, for each sub-key inthe enumeration, its category of existence is determined. Sub-keys withnegative existence are removed from the working data store, and sub-keyswith positive existence, i.e. those that exist and are not marked asplaceholders and are not marked as deleted, are added to the workingdata store, replacing the corresponding sub-key if one is alreadypresent in the working data store (step 1018), followed by step 1030 asdescribed below.

Then, for all three types of rules, step 1030 is executed. The rulesengine is queried to find the set of rules whose filters match immediatechildren of the requested virtual key name, but do not match therequested virtual key name itself (step 1030). For each rule in the set,the existence of the virtual child whose name matches the name in therule is determined. If the child has positive existence, it is added tothe working data store, replacing any child of the same name alreadythere. If the child has negative existence, the entry in the workingdata store corresponding to the child, if any, is removed. (Step 1032).Finally, the constructed enumeration is then returned from the workingdata store to the requestor (step 1020).

Still referring to FIG. 16, and in more detail, in order to enumerate akey, it is first opened with enumerate access (step 1001). The requestto open the key with enumerate access includes the name of the key whichis treated as a virtual name by the isolation environment 260. A fullvirtualized key open is performed as described above. If the virtualizedopen operation fails, an error is returned to the requester (step 1040).If the virtualized open operation succeeds, the handle of the literalkey corresponding to the virtual key is returned to the requestor.Subsequently a request to enumerate the registry key which was opened instep 1001 is received or intercepted (step 1002). The opened literalregistry key may be of user scope, installation scope, system scope, orsome applicable sub-scope. In some embodiments, the enumerate request ishooked by a function that replaces the operating system 210 function orfunctions for enumerating a registry key. In another embodiment ahooking dynamically-linked library is used to intercept the enumeraterequest. The hooking function may execute in user mode or in kernelmode. For embodiments in which the hooking function executes in usermode, the hooking function may be loaded into the address space of aprocess when that process is created. For embodiments in which thehooking function executes in kernel mode, the hooking function may beassociated with an operating system 210 resource that is used indispatching requests for native registry keys. In other embodiments, aregistry filter driver facility conceptually similar to a file systemfilter driver facility may be provided by the operating system 210. Apractitioner skilled in the art may create a registry filter driver, towhich the operating system 210 passes requests to perform registryoperations, thus providing a mechanism to intercept registry operationrequests. For embodiments in which a separate operating system 210function is provided for each type of registry key function, eachfunction may be hooked separately. Alternatively, a single hookingfunction may be provided which intercepts create or open calls forseveral types of registry key functions.

The enumerate request contains a literal key handle. The virtual keyname associated with the handle is determined by querying the operatingsystem 210 for the literal name associated with the handle. The rulesengine is consulted to determine the virtual name associated with theliteral name, if any.

A rule determining how the registry key operation is processed (step1004) is obtained by consulting the rules engine. In some embodiments,the virtual key name of the virtual registry key to be enumerated isused to locate in the rule engine a rule that applies to the request. Inparticular ones of these embodiments, multiple rules may exist in therules engine for a particular virtual registry key and, in some of theseembodiments, the rule having the longest prefix match with the virtualkey name is the rule applied to the request. In some embodiments, therules engine may be provided as a relational database. In otherembodiments, the rules engine may be a tree-structured database, a hashtable, or a flat registry key database. In some embodiments, the virtualkey name corresponding to the virtual key handle in the request is usedas an index into a rules engine to locate one or more rules that applyto the request. In some embodiments, a process identifier is used tolocate in the rule engine a rule that applies to the request, if oneexists. The rule associated with a request may be to ignore the request,redirect the request, or isolate the request. The rule lookup may occuras a series of decisions, or the rule lookup may occur as a singledatabase transaction.

If the rule action is not “isolate” (step 1006), but is “ignore” or is“redirect”, then a request to enumerate the literal key is passed to theoperating system 210 using the literal key handle, and the enumerationresults, if any, are stored in the working data store (step 1012), andstep 1030 is executed as described later.

In one embodiment, this is accomplished by calling the original versionof the hooked function and passing the formed literal name to thefunction as an argument. In other embodiments, a registry filter driverfacility conceptually similar to a file system filter driver facilitymay be provided by the operating system 210. In these embodiments,enumerating the literal registry key may be achieved by responding tothe original request to enumerate the key by signaling to the registryfilter manager to process the unmodified request in the normal fashion.

If the rule action determined in step 1010 is “isolate”, then the systemscope is enumerated. To achieve this, the candidate key is identified asthe system-scope key corresponding to the virtual key to be enumerated.The candidate key is enumerated, and the results of the enumeration arestored in a working data store (step 1014). In some embodiments, theworking data store is comprised of a memory element. In otherembodiments, the working data store comprises a database or a key or asolid-state memory element or a persistent data store.

Next, a subroutine is called to cycle through the installation scopesthe candidate key is identified as the installation-scope instance ofthe virtual key, and the category of existence of the candidate key isdetermined (step 1015). If the candidate key has “negative existence”,i.e. it or one of its ancestors in the scope is marked as deleted, thenwithin this scope it is known to be deleted, and this is indicated byflushing the working data store (step 1042).

In some embodiments, the candidate registry key may be associated withmetadata indicating that the candidate registry key has been deleted. Insome embodiments, metadata about a registry key may be stored in adistinguished value held by that key, with the existence of that valuehidden from ordinary application usage of registry APIs. In someembodiments, small amounts of metadata about a registry key may bestored directly in the literal key name, such as by suffixing thevirtual name with a metadata indicator, where a metadata indicator is astring uniquely associated with a particular metadata state. Themetadata indicator may indicate or encode one or several bits ofmetadata. Requests to access the key by virtual name check for possiblevariations of the literal key name due to the presence of a metadataindicator, and requests to retrieve the name of the key itself arehooked or intercepted in order to respond with the literal name. Inother embodiments, the metadata indicator may be encoded in a sub-keyname or a registry value name instead of the key name itself. In stillother embodiments, a registry key system may directly provide theability to store some 3rd party metadata for each key. In someembodiments, metadata is stored in a database or other repositoryseparate from the registry database. In some embodiments, a separatesub-scope may be used to store keys that are marked as deleted. Theexistence of a key in the sub-scope indicates that the key is marked asdeleted.

If instead, in step 1015, the candidate key does not have negativeexistence, the candidate key is enumerated and any enumeration resultsobtained are merged into the working data store. In particular, for eachsub-key in the enumeration, its category of existence is determined.Sub-keys with negative existence are removed from the working datastore, and sub-keys with positive existence, i.e. those that exist andare not marked as placeholders and are not marked as deleted, are addedto the working data store, replacing the corresponding sub-key if one isalready present in the working data store (step 1016).

In either case, the candidate key is identified as the user-scopeinstance of the virtual key, and the category of existence of thecandidate key is determined (step 1017). If the candidate key has“negative existence”, i.e. it or one of its ancestors in the scope ismarked as deleted, then within this scope it is known to be deleted, andthis is indicated by flushing the working data store (step 1044). Ifinstead the candidate key does not have negative existence, thecandidate key is enumerated and any enumeration results obtained aremerged into the working data store. In particular, for each sub-key inthe enumeration, its category of existence is determined. Sub-keys withnegative existence are removed from the working data store, and sub-keyswith positive existence, i.e. those that exist and are not marked asplaceholders and are not marked as deleted, are added to the workingdata store, replacing the corresponding sub-key if one is alreadypresent in the working data store (step 1018), followed by step 1030 asdescribed below.

Then, for all three types of rules, step 1030 is executed. The rulesengine is queried to find the set of rules whose filters match immediatechildren of the requested key, but do not match the requested key itself(step 1030). For each rule in the set, the existence of the virtualchild whose name matches the name in the rule is determined. In someembodiments, this is determined by examining the appropriate scope andthe metadata associated with the virtual child. In other embodiments,this is determined by attempting to open the key. If the open requestsucceeds, the virtual child has positive existence. If the open requestfails with an indication that the virtual child does not exist, thevirtual child has negative existence.

If the child has positive existence, it is added to the working datastore, replacing any child of the same name already there. If the childhas negative existence, the child in the working data storecorresponding to the virtual child, if any, is removed. (Step 1032).Finally, the constructed enumeration is then returned from the workingdata store to the requestor (step 1020).

A practitioner of ordinary skill in the art realizes that the layeredenumeration process described above can be applied with minormodification to the operation of enumerating a single scope whichcomprises a plurality of sub-scopes. A working data store is created,successive sub-scopes are enumerated and the results are merged into theworking data store to form the aggregated enumeration of the scope.

Referring now to FIG. 17, and in brief overview, one embodiment of thesteps taken to create a key in the isolation environment 260 is shown. Arequest to create a key is received or intercepted (step 1102). Therequest contains a key name, which is treated as a virtual key name bythe isolation environment 260. An attempt is made to open the requestedkey using full virtualization using applicable rules, i.e. usingappropriate user and installation scope, as described above (step 1104).If access is denied (step 1106), an access denied error is returned tothe requester (step 1109). If access is granted (step 1106), and therequested key is successfully opened (step 1110), the requested key isreturned to the requester (step 1112). However, if access is granted(step 1106), but the requested key is not opened successfully (step1110) then if the parent of the requested key also does not exist (step1114), an error appropriate to the request semantics is issued to therequester (step 1116). If on the other hand, the parent of the requestedkey is found in full virtualized view using the appropriate user andinstallation scope (step 1114), a rule then determines how the keyoperation is processed (step 1118). If the rule action is “redirect” or“ignore” (step 1120), then the virtual key name is mapped directly to aliteral key name according to the rule. Specifically, if the rule actionis “ignore”, the literal key name is identified as exactly the virtualkey name. If instead, the rule action is “redirect”, the literal keyname is determined from the virtual key name as specified by the rule.Then a request to create the literal key is passed to the operatingsystem 210, and the result is returned to the requester (step 1124). Ifon the other hand, the rule action determined in step 1120 is “isolate”,then the literal key name is identified as the instance of the virtualkey name in the user scope. If the literal key already exists, but isassociated with metadata indicating that it is a placeholder or that itis deleted, then the associated metadata is modified to remove thoseindications, and it is ensured that the key is empty. In either case, arequest to open the literal key is passed to the operating system 210(step 1126). If the literal key was opened successfully (step 1128), theliteral key is returned to the requester (step 1130). If on the otherhand, in step 1128, the requested key fails to open, placeholders foreach ancestor of the literal key that does not currently exist in theuser scope (step 1132) and a request to create the literal key using theliteral name is passed to the operating system 210 and the result isreturned to the requester (step 1134).

Still referring to FIG. 17, and in more detail, a request to create akey is received or intercepted (step 1102). In some embodiments, therequest is hooked by a function that replaces the operating system 210function or functions for creating the key. In another embodiment, ahooking dynamically-linked library is used to intercept the request. Thehooking function may execute in user mode or in kernel mode. Forembodiments in which the hooking function executes in user mode, thehooking function may be loaded into the address space of a process whenthat process is created. For embodiments in which the hooking functionexecutes in kernel mode, the hooking function may be associated with anoperating system 210 resource that is used in dispatching requests forkey operations. For embodiments in which a separate operating system 210function is provided for each type of key operation, each function maybe hooked separately. Alternatively, a single hooking function may beprovided which intercepts create or open calls for several types of keyoperations.

The request contains a key name, which is treated as a virtual key nameby the isolation environment 260. In some embodiments, the virtual keyname may be expressed as a combination of a handle to a parent key, andthe relative path name to the descendant key. The parent key handle isassociated with a literal key name, which is itself associated with avirtual key name. The requester attempts to open the virtual key usingfull virtualization using applicable rules, i.e. using appropriate userand installation scope, as above described (step 1104). If access isdenied during the full virtualized open operation (step 1106), an accessdenied error is returned to the requestor (step 1109). If access isgranted (step 1106), and the requested virtual key is successfullyopened (step 1110), the corresponding literal key is returned to therequester (step 1112). However, if access is granted (step 1106), butthe virtual key is not opened successfully (step 1110) then the virtualkey has been determined not to exist. If the virtual parent of therequested virtual key also does not exist, as determined above (step1114), an error appropriate to the request semantics is issued to therequester (step 1116). If on the other hand, the virtual parent of therequested virtual key is found in full virtualized view using theappropriate user and installation scope (step 1114), then a rule thatdetermines how the create operation is processed is located (step 1118)by consulting the rules engine. In some embodiments, the rules enginemay be provided as a relational database. In other embodiments, therules engine may be a tree-structured database, a hash table, or a flatkey database. In some embodiments, the virtual key name provided for therequested key is used to locate in the rule engine a rule that appliesto the request. In particular ones of these embodiments, multiple rulesmay exist in the rules engine for a particular key and, in some of theseembodiments, the rule having the longest prefix match with the virtualkey name is the rule applied to the request. In some embodiments, aprocess identifier is used to locate in the rule engine a rule thatapplies to the request, if one exists. The rule associated with arequest may be to ignore the request, redirect the request, or isolatethe request. Although shown in FIG. 17 as a single database transactionor single lookup into a key, the rule lookup may be performed as aseries of rule lookups.

If the rule action is “redirect” or “ignore” (step 1120), the virtualkey name is mapped directly to a literal key name according to the rule(step 1124). If the rule action is “redirect” (step 1120), the literalkey name is determined from the virtual key name as specified by therule (step 1124). If the rule action is “ignore” (step 1120), theliteral key name is determined to be exactly the virtual key name (step1124). If the rule action is “ignore” or the rule action is “redirect”,a request to create the literal key using the determined literal keyname is passed to the operating system 210 and the result from theoperating system 210 is returned to the requester (step 1124). Forexample, a request to create a virtual key named “key_1” may result inthe creation of a literal key named “Different_key_1.” In oneembodiment, this is accomplished by calling the original version of thehooked function and passing the formed literal name to the function asan argument (step 1124). In other embodiments, a registry filter driverfacility conceptually similar to a file system filter driver facilitymay be provided by the operating system 210. In these embodiments,creating the literal registry key may be achieved by responding to theoriginal request to create the virtual key by signaling to the registryfilter manager to reparse the request using the determined literal keyname.

If the rule action determined in step 1120 is not “ignore” or “redirect”but is “isolate,” then the literal key name is identified as theinstance of the virtual key name in the user scope. If the literal keyalready exists, but is associated with metadata indicating that it is aplaceholder or that it is deleted, then the associated metadata ismodified to remove those indications, and it is ensured that the key isempty.

In some embodiments, metadata about a registry key may be stored in adistinguished value held by that key, with the existence of that valuehidden from ordinary application usage of registry APIs. In someembodiments, small amounts of metadata about a registry key may bestored directly in the literal key name, such as by suffixing thevirtual name with a metadata indicator, where a metadata indicator is astring uniquely associated with a particular metadata state. Themetadata indicator may indicate or encode one or several bits ofmetadata. Requests to access the key by virtual name check for possiblevariations of the literal key name due to the presence of a metadataindicator, and requests to retrieve the name of the key itself arehooked or intercepted in order to respond with the literal name. Inother embodiments, the metadata indicator may be encoded in a sub-keyname or a registry value name instead of the key name itself. In stillother embodiments, a registry key system may directly provide theability to store some 3rd party metadata for each key. In someembodiments, metadata could be stored in a database or other repositoryseparate from the registry database. In some embodiments, a separatesub-scope may be used to store keys that are marked as deleted. Theexistence of a key in the sub-scope indicates that the key is marked asdeleted.

In specific ones of these embodiments, a list of deleted keys or keysystem elements may be maintained and consulted to optimize this checkfor deleted keys. In these embodiments, if a deleted key is recreatedthen the key name may be removed from the list of deleted keys. Inothers of these embodiments, a key name may be removed from the list ifthe list grows beyond a certain size.

In either case, a request to open the user-scope literal key is passedto the operating system 210 (step 1126). In some embodiments, rules mayspecify that the literal key corresponding to the virtual key should becreated in a scope other than the user scope, such as the installationscope, the system scope, a user sub-scope or an installation sub-scope.

If the literal key was opened successfully (step 1128), the literal keyis returned to the requester (step 1130). If on the other hand, in step1128, the requested key fails to open, placeholders are created for eachancestor of the literal key that does not currently exist in the userscope (step 1132) and a request to create the literal key using theliteral name is passed to the operating system 210 and the result isreturned to the requester (step 1134).

This embodiment is for operating systems 210 with APIs or facilitiesthat only support creation of one level per call/invocation. Extensionto multi-levels per call/invocation should be obvious to one skilled inthe art.

Illustrated in FIG. 18 is one embodiment of the subroutine 2701 calledin the process illustrated in FIG. 14. This subroutine is a method,executed within the method 811 depicted in FIG. 14, to cycle through theone or more installation scopes included in the isolation environment260. When the existence of a user-scope candidate key is determined instep 816 of the method 811 in FIG. 14 to have a neutral existence, thesubroutine 2701 is called and a candidate key name is identified in thefirst installation scope (step 2724). It is then determined whether ornot a candidate key name was in fact found in the first installationscope (step 2702). If a candidate key name is found then a check is doneas to whether or not this found candidate key name has a negativeexistence indicating that that found file has been marked for deletionor is otherwise no longer present in the installation scope (step 2704).When the candidate key name has a negative existence, a check is thedone to determine if there are more installation scopes within theisolation environment 260 (step 2710), however if the candidate key namedoes not have a negative existence, then a check is done to determine ifthe candidate key name has a neutral existence (step 2706). When thecandidate key name has a neutral existence this indicates that the keymay be a placeholder or that the key may not exist, and so the isolationscope 260 is further analyzed to determine if there are additionalinstallation scopes present in the isolation environment 260 (step2710). If the candidate key name does not have a neutral existence, thena value is returned to the main method 811 indicating that the candidatekey name has a positive existence (step 2708). If after step 2724, it isdetermined that a candidate key name was not found (step 2702), then theisolation environment 260 is analyzed to determine if there areadditional installation scopes in the isolation environment 260 (step2710). When it is determined that there are additional installationscopes present, a second candidate key name is identified in the nextinstallation scope (step 2712). Once the next installation scope isanalyzed, it is determined whether or not a candidate key name was foundin that installation scope (step 2714). When a candidate key name isfound, that key is then checked to determine whether or not is has anegative existence (step 2704), or a neutral existence (step 2706). If asecond candidate key name is not found, then a check is done as towhether or not there are additional installation scopes (step 2710).When no more additional installation scopes are identified (step 2710),a check is done as to whether a candidate key name was found during thelast check (step 2724, step 2712), and if no key name is found, anegative value is returned to the main method 811 (step 2722). If acandidate key name is found (step 2716), then it is determined whetheror not the found candidate key name has a neutral existence (step 2718).When the candidate key name has a neutral existence, a neutral value isreturned to the main method 811 (step 2720), and when the candidate keyname does not have a neutral existence, a negative value is returned tothe main method 811 (step 2722).

Further referring to FIG. 18 in more detail, in one embodiment of thesubroutine 2701, a candidate key name is identified in the firstinstallation scope (step 2724). Other embodiments may include asubroutine 2701 that checks for the candidate key name in the lastinstallation scope or in another installation scope where the locationof the installation scope is either a user-defined value or apre-determined value. Still further embodiments include a subroutine2701 where the first installation scope is the installation scope is thehighest priority installation scope within the isolation environment260. Embodiments of the subroutine 2701 may include a first installationscope that is the lowest priority installation scope within theisolation environment 260, a first installation scope that has thehighest priority within a sub-scope of installation scopes, or a firstinstallation scope that has the lowest priority within a sub-scope ofinstallation scopes. It is then determined whether or not a candidatekey name was found in the first installation scope (step 2702). In oneembodiment of the process 2701, when a candidate key is found in thefirst installation scope, determinations are made as to whether the keyname has a negative existence (step 2704), a neutral existence (step2706), or a positive existence (step 2708). When a key name has anegative existence, further determinations are made as to whether or notthere are additional installation scopes (step 2710), if there are noother installation scopes then a verification is made that a candidatekey name was found (step 2716) and a determination is made as to whetheror not the candidate key name is neutral (step 2718) or negative (step2722). When a key name does not have a negative existence, adetermination is made as to whether the key name has a neutral existence(step 2706), and if the candidate key does not have a neutral existence(step 2706), then a positive value indicating a candidate key name witha positive existence is returned to the main process 811 (step 2708). Ifa key name has a neutral existence then a check is done as to whether ornot additional installation scopes are included in the isolationenvironment 260 (step 2710), if there are no other installation scopesthen a verification is made that a candidate key name was found (step2716) and a determination is made as to whether or not the candidate keyname is neutral (step 2718) or negative (step 2722).

In one embodiment, when a candidate key name is not found in the firstinstallation scope, a determination is made as to whether or not thereexist additional installation scopes within the isolation environment260 (step 2710). Other embodiments may be configured to search through apre-determined number of installation scopes. When additionalinstallation scopes exist, a next installation scope is searched toidentify a candidate key name (step 2712). In one embodiment, the nextinstallation scope is the installation scope that is one priority levelless than the priority level of the previously checked installationscope. For example, in this embodiment if the previously checkinstallation scope was the first installation scope with the highestpriority, then the next installation scope would be the installationscope with the second highest priority. When additional installationscopes do not exist, a determination is made as to whether or not acandidate key name was previously identified (step 2716). In oneembodiment, a previously identified candidate key name would includekeys identified by the method 811 before a check was made as to theexistence of additional installation scopes.

When additional installation scopes are included within the isolationenvironment 260, the method attempts to identify a candidate key in eachinstallation scope (2712). In one embodiment, a determination is made asto whether or not a candidate key was found (step 2714), and if acandidate key was found, the file is then analyzed to determine if thekey has a negative existence (step 2704), a neutral existence (step2706), or a positive existence (step 2708). When a candidate key name isnot found (2714), then a check is made for more installation scopes(step 2710), and if there are no additional installation scopes, it isverified that a candidate key was found (step 2716). If a candidate keywas not found, a negative value is returned (step 2722), and if acandidate key is found, then a determination is made as to whether thecandidate key is neutral (step 2718).

Illustrated in FIG. 19 is one embodiment of a subroutine 2741 called bythe method 1003 in FIG. 16. In one embodiment, a subroutine 2741 iscalled by the process 1003 in FIG. 16 to cycle through all installationscopes included in the isolation environment 260, and identify aninstallation scope with a positive existence. After storing theenumerated system scope results in a working data store (step 1014), afirst installation scope candidate is identified (2742). A determinationis made as to whether or not the first installation scope candidate hasa negative existence (2744). When the first installation scope has apositive existence, a positive value is returned to the main process1003 (step 2746), and the installation scope is enumerated into theworking data store (step 1016). When the first installation scope has anegative existence, a check is made for the existence of additionalinstallation scopes within the isolation environment 260 (step 2748). Ifthere are no additional installation scopes, then a negative value isreturned to the main process 1003 (step 2754). If there are additionalinstallation scopes, then a next candidate installation scope isidentified (step 2750) and a determination is made as to whether or notthe next installation scope has a negative existence (step 2744). Averification is made as to whether or not the next candidateinstallation scope

Referring to FIG. 19 in more detail, when the subroutine 2741 is calledfrom the main process 1003, an embodiment of which is illustrated inFIG. 16, a first installation scope candidate is identified (step 2742).In one embodiment, the first installation scope candidate is theinstallation scope that has a higher priority than all otherinstallation scopes included in the isolation environment 260. Otherembodiments may include a first installation scope candidate that is theinstallation scope that has a lower priority than all other installationscopes included in the isolation environment 260. Still otherembodiments may include a first installation sub-scope that has a higherpriority than the other installation sub-scopes, or a first installationscope that has a higher priority than the other installation scopesincluded in a sub-isolation environment 260.

An embodiment of the process 2741 makes a determination as to whether ornot the installation scope has a negative existence (step 2744). In oneembodiment, when the installation scope does have a negative existence(step 2744), a check is made to determine whether or not the isolationenvironment 260 includes additional installation scopes (step 2748). Inanother embodiment, when the installation scope does not have a negativeexistence (step 2744), a positive value is returned to the main process1003 (step 2746).

One embodiment of the method 2741 determines whether or not there existadditional installation scopes within the isolation environment 260(step 2748). In one embodiment, when there exist no additionalinstallation scopes, a negative value is returned to the main process1003 (step 2746), while in another embodiment a next installation scopecandidate is identified (step 2750) when there exist additionalinstallation scopes within the isolation environment 260.

Named Object Virtualization

Another class of system-scope resources that may be virtualized usingthe techniques described above are named objects, which can includesemaphores, mutexes, mutants, waitable timers, events, job objects,sections, named pipes, mailslots, or any other object that can be aresource for an application. These objects are characterized in thatthey typically exist only for the duration of the process which createsthem. The name space for these objects may be valid over an entirecomputer (global in scope) or only in an individual user session(session scope).

Referring now to FIG. 20, and in brief overview, a request to create oropen a named object is received or intercepted (step 1202). That requestcontains an object name which is treated as a virtual name by theisolation environment 260. A rule determining how to treat the requestis determined (step 1204). If the rule indicates that the request shouldbe ignored (step 1206), the literal object name is determined to be thevirtual name (step 1207), and a request to create or open the literalobject is issued to the operating system 210 (step 1214). If thedetermined rule is not to ignore the request, but indicates instead thatthe request should be redirected (step 1208), the literal object name isdetermined from the virtual name as specified by the redirection rule(step 1210) and a create or open request for the literal object isissued to the operating system (step 1214). If the rule does notindicate that the request should be redirected (step 1208), but insteadindicates that the request should be isolated, then the literal objectname is determined from the virtual name as specified by the isolationrule (step 1212) and a create or open command for the literal object isissued to the operating system 210 (step 1214). The handle of theliteral object returned by the operating system 210 in response to theissued create or open command is returned to the program requestingcreation or opening of the virtual object (step 1216).

Still referring to FIG. 20, and in more detail, a request from a processto create or open a named object is intercepted (step 1202). The namedobject may be of session scope or it may be of global scope. In someembodiments, the request is hooked by a function that replaces theoperating system function or functions for creating or opening the namedobject. In another embodiment a hooking dynamically-linked library isused to intercept the request. The hooking function may execute in usermode or in kernel mode. For embodiments in which the hooking functionexecutes in user mode, the hooking function may be loaded into theaddress space of a process when that process is created. For embodimentsin which the hooking function executes in kernel mode, the hookingfunction may be associated with an operating system 210 resource that isused in dispatching requests for system objects. The request to createor open the named object may refer to any one of a wide variety ofsystem-scope resources that are used for inter-process communication andsynchronization and that are identified by a unique identifier includingsemaphores, mutexes, mutants, waitable timers, file-mapping objects,events, job objects, sections, named pipes, and mailslots. Forembodiments in which a separate operating system function is providedfor each type of object, each function may be hooked separately.Alternatively, a single hooking function may be provided whichintercepts create or open calls for several types of objects.

The intercepted request contains an object name which is treated as avirtual name by the isolation environment 260. A rule determining how totreat the request for the object is determined (step 1204) by consultingthe rules engine. In some embodiments, the rules engine may be providedas a relational database. In other embodiments, the rules engine may bea tree-structured database, a hash table, or a flat file database. Insome embodiments, the virtual name provided for the requested object isused to locate in the rule engine a rule that applies to the request. Inparticular ones of these embodiments, multiple rules may exist in therules engine for a particular object and, in these embodiments, the rulehaving the longest prefix match with the virtual name is the ruleapplied to the request. In some embodiments, a process identifier isused to locate in the rule engine a rule that applies to the request, ifone exists. The rule associated with a request may be to ignore therequest, redirect the request, or isolate the request. Although shown inFIG. 18 as a series of decisions, the rule lookup may occur as a singledatabase transaction.

If the rule indicates that the request should be ignored (step 1206),the literal object name is determined to be the virtual name, and arequest to create or open the literal object is issued to the operatingsystem 210 (step 1214). For example, a request to create or open a namedobject named “Object_1” results in the creation of an actual objectnamed “Object_1”. In one embodiment, this is accomplished by calling theoriginal version of the hooked function and passing the formed literalname to the function as an argument.

If the rule determined by accessing the rules engine is not to ignorethe request, but indicates instead that the request should be redirected(step 1208), the literal object name is determined from the virtual nameas specified by the redirection rule (step 1210) and a create or openrequest for the literal object is issued to the operating system 210(step 1214). For example, a request to create or open a named objectnamed “Object_1” may result in the creation of an actual object named“Different_Object_1”. In one embodiment, this is accomplished by callingthe original version of the hooked function and passing the formedliteral name to the function as an argument.

If the rule does not indicate that the request should be redirected(step 1208), but instead indicates that the request is isolated, thenthe literal object name is determined from the virtual name as specifiedby the isolation rule (step 1212) and a create or open command for theliteral object is issued to the operating system 210 (step 1214). Forexample, a request to create or open a named object named “Object_1” mayresult in the creation of an actual object named “Isolated_Object_1”. Inone embodiment, this is accomplished by calling the original version ofthe hooked function and passing the formed literal name to the functionas an argument.

The literal name formed in order to isolate a requested system objectmay be based on the virtual name received and a scope-specificidentifier. The scope-specific identifier may be an identifierassociated with an installation scope, a user scope, a session scope, orsome combination of the three. The scope-specific identifier is used to“mangle” the virtual name received in the request. For example, if therequest for the named object “Object_1” is isolated for the installationscope whose associated identifier is “SA1”, the literal name may be“Isolated_AppScope_SA1_Object_1”. The following table identifies theeffect of mangling the name of an object with session scope, or userscope, and an installation scope. Mangling with combinations of scopescombines the restrictions listed in the table.

Session-specific User-specific Installation-specific identifieridentifier identifier Global Object available to Object available toObject available to object all isolated all isolated all isolatedapplications applications applications executing in the executing onbehalf executing in an context of the user of the user installationscope session Session Object available to Object available to Objectavailable to object all isolated all isolated all isolated applicationsapplications applications executing in the executing in the executing inan context of the user session on behalf of installation scope sessionthe user within the session

For embodiments in which the operating system 210 is one of the WINDOWSfamily of operating systems, object scope may be modified by togglingthe global/local name prefix associated with the object, which, forisolated applications, has the same effect as mangling the object namewith a session-specific identifier. However, toggling the global/localname prefix also affects the object scope for non-isolated applications.

The handle of the literal object returned by the operating system 210 inresponse to the command issued in step 1214 to create or open the namedobject is returned to the program requesting creation or opening of thevirtual object (step 1216).

Application-Specific User Root

Illustrated in FIG. 21A is one embodiment of the computing machine 200configured to provide access to more than one user 238, 240, 242 andhaving user scopes configured to provide application-specific,user-specific native resources. The illustrated computing machine 200includes the following components: an operating system 210 installedthereon; user sessions 238, 240, 242 indicative of user actions; andapplications 202, 204, 206, 206′ executing within the user sessions 238,240, 242. The operating system 210 has a system root 216, aninstallation root 214, and a user root 211. Included within the systemroot 216 is a system scope 256 that further includes native resources258 such as: a file system 218; a registry 220; and objects 222. Theinstallation root 214 includes more than one installation scope 244,246, 252, 248, 250, 254, where each installation scope is connected toanother scope. Included within each installation scope are instances ofnative resources 258′, 258″, 258′″, 258″″, 258′″″, 258″″″. The user root212 includes more than one user scope 2103, 2106, 2109, where each scopeis associated with a user session 238, 240, 242 and each scope includesan instance of native resources. An isolation environment 260 isincluded within the operating system 210 that groups together the userroot 212 and the installation root 214.

Referring to FIG. 21A and in more detail, the elements included withinFIG. 21A are substantially similar to those included in FIG. 2B with theexception of a user root 212 that includes user scopes 2103, 2106, 2109dedicated to storing application-specific, user-specified settings. Afurther exception is the applications executed by the third user withinthe third user session. In this user session, the third user executestwo instances of a third application 206, 206′. In one embodiment, theuser scopes 2103, 2106, 2109 include native resources that correspond toan application profile. Each application profile includesapplication-specific setting information. In one embodiment of thecomputing machine 200, a user, executing an application within a usersession, alters the settings of the executing application. The alteredsettings are stored in an application profile which is furtherrepresented by a set of native resources included within the user scope.When a user executes that application, the application executesaccording to the altered application settings. An example of thisincludes a first user executing a first application 202 within a firstuser session 238. In this example, the user scope 2103 corresponding tothe first application stores all of the first user-specified applicationsettings for the first application, and makes those settings availableto the first application each time the first application is executed bythe first user. Further referring to this example, if the first userwere to execute the first application in more than one isolationenvironment, the instance of the first application appearing in eachisolation environment would have the same application-specific anduser-specified application settings.

In one embodiment of the computing machine 200, a third user executingtwo instances of a third application 206, 206′ within a third usersession 242 is included. A user scope 2109 that includes nativeresources specific to the third application is also included within thisembodiment. Each instance of the third application 206, 206′, in thisembodiment, is configured to execute within the third user session 242according to those application-specific and user-specified resourcesincluded within the user scope 2109. Other embodiments may include auser scope 2109 that has sub-scopes configured to store settinginformation for more than one application.

One example of the computing machine depicted in FIG. 21A includes afirst installation scope within a first isolation environment andassociated with a first application. Included within the firstinstallation scope is an executable component that is configured toexecute the first application. Further included within a secondisolation environment is a second installation scope associated with thefirst application. Included within the second installation scope is anexecutable component that is configured to execute the firstapplication. A user scope is included in each of the first isolationenvironment and the second isolation environment, where the user scopestores an application profile with user setting information specific tothe execution of the first application. The choice of whichapplication-specific user scope to include in an isolation environment,is based on which installation scope includes the an executablecomponent. In this example, each of the first isolation environment andthe second isolation environment had an installation scope with anexecutable component, where that installation scope corresponded to thefirst application. Based on the location of the first executablecomponent, the user scope included in both the first isolationenvironment and the second isolation environment is a user scope thatcorresponds to the first application. In this example, as well as otherexamples, the choice of which user scope to include is referred to adefining the user scope. To define a user scope based on an associationbetween the executable component and an application; is to determinewhich application the user scope corresponds to, based on whichinstallation profile includes an executable component. Other embodimentsinclude defining the user scope based on the first found executablecomponent.

Illustrated in FIG. 21B is an embodiment of a block diagram of a virtualscope 2130 configured to aggregate more than one isolation scope tocreate a virtualized native resource view included within the virtualscope 2130. Within the virtual scope 2130 is an aggregation of thefollowing isolation scopes: a user-application 1 scope 2120corresponding to a first application; an installation scopecorresponding to a first application 2124A; an installation scopecorresponding to a second application 2124B; an installation scopecorresponding to an N application 2124N; and a system scope 2126.

Further referring to FIG. 21B in more detail, in one embodiment of thevirtual scope 2130, a user scope is included that contains nativeresources used by a first application to execute. In one embodiment, thenative resources contained within the virtual scope 2130 areuser-specified application settings that direct the application toexecute according to user-specified settings. In another embodiment, thenative resources contained within the virtual scope 2130 are applicationsettings that correspond to an application profile for the firstapplication. This application profile is generated based onuser-specified setting information, and the profile dictates the mannerin which the first setting should execute. The virtual scope 2130 caninclude, in some embodiments, a user scope 2120 that has a sub-scopededicated to first application setting information, and additionalsub-scopes dedicated to other application setting information. Stillother embodiments of the virtual scope 2130 include a user scope withsub-scopes where at least one of the sub-scopes is dedicated toproviding first application-specific setting information.

The installation scopes 2124A-2124N illustrated in FIG. 21B aresubstantially similar to those installation scopes 284A-284N includedwithin the virtual scope 262 depicted in FIG. 4. Furthermore, the systemscope 2126 illustrated in FIG. 21B is substantially similar to thesystem scope 286 within the virtual scope 262 depicted in FIG. 4.Differences between FIG. 4 and FIG. 21B include installation scopes2124A-2124N representative of applications such that a firstinstallation scope 2124A is representative of a first application, asecond installation scope 2124B is representative of a secondapplication, and an N installation scope 2124N is representative of an Napplication.

Illustrated in FIG. 21C is a flowchart depicting a method 2203 foraggregating native resources found within isolation scopes. The method2203 includes intercepting a request generated by a first application(step 2206), where the request is for an enumeration of a nativeresource (step 2206). An enumeration of system scope instances of thenative resource is performed, and all encountered instances of therequested native resource are added to a virtualized native resourceview (step 2209). The method 2203 further includes enumerating thenative resource instances included in each installation scope (step2212); and adding those resource instances found, and replacing thosenative resources that already exist within the virtualized nativeresource view with newly found native resource instances (step 2215). Adetermination is then made as to whether or not there exists a userscope that corresponds to the first application (step 2218). If a userscope exists that is configured to include first application-specificsettings, then the first application/user scope is searched for aninstance of the requested native resource (step 2221). When no userscope, corresponding to the first application, is found; a search isperformed within the existing user scope for an instance of therequested native resource (step 2227). Once a search is performed eitherwithin a non-specific user scope, or a user scope that is specific tothe first application; each of the found native resource instances areadded to the virtualized native resource view and those resourcesalready within the virtualized view are replaced with substantiallysimilar resources found within one of the user scopes (step 2224).

Further referring to FIG. 21C and in more detail, aspects of the method2203 that substantially correspond to those aspects of the method 401illustrated in FIG. 3A may be embodied according to any of theembodiments or configurations in the above described method 401. Aspectsof the method 2203 that differs from the method 401 illustrated in FIG.3A are those that refer to determining a first application-specific userscope (step 2218), and further searching that application-specific userscope (step 2221). In one embodiment of the method 2203, a filter driveris used to determine whether or not an application-specific user scopeexists, and to further search a known application-specific user scope.Other embodiments of the method 2203 include an application-specificuser scope that includes first application setting information generatedby a user and stored within the first application-specific user scope.Still other embodiments include a user scope with a sub-scope dedicatedto providing an instance of native resources that are defined by a userand that are used by the first application to execute according touser-specified parameters. Further embodiments include a method 2203that searches a first application-specific scope while the firstapplication is executing within the same user session and in a differentisolation environment.

1. A method for associating installation scopes to facilitate updatinginstances of native resources, the method comprising: executing a firstapplication within a first isolation environment, mounting an image of asecond application, executing a third application within a secondisolation environment; intercepting a request to retrieve and update anative resource sent by the third application associated with a thirdinstallation scope and located within the second isolation environment;failing to locate, within the third installation scope, an instance of anative resource corresponding to the requested native resource;determining that there is an association between the third installationscope and a second installation scope representative of the image of thesecond application; retrieving an instance of the requested nativeresource, the instance located within the second installation scope;updating the retrieved instance of the requested native resource andreturning the updated native resource to the second installation scope;intercepting a request to retrieve the native resource, the request sentby the first application associated with a first installation scopelocated within the first isolation environment; failing to locate,within the first installation scope, a native resource corresponding tothe requested native resource; determining an association between thefirst installation scope and the second installation scope; retrievingan instance of the updated native resource located within the secondinstallation scope; and returning the updated native resource to thefirst application.
 2. The method of claim 1, wherein the image of thesecond application is mounted within the first isolation environment. 3.The method of claim 1, wherein the image of the second application ismounted within the second isolation environment.
 4. The method of claim1, further comprising: creating the association between the first andsecond installation scopes.
 5. The method of claim 1, furthercomprising: creating the association between the second and thirdinstallation scopes.
 6. The method of claim 1, further comprising:creating an association between the first, second, and thirdinstallation scopes.
 7. The method of claim 1, wherein the associationbetween the third and second installation scopes is also an associationwith the first installation scope.
 8. The method of claim 1, wherein theassociation between the first and second installation scopes is also anassociation with the third installation scope.
 9. The method of claim 1,further comprising: enumerating the resources in the first and secondinstallation scopes.
 10. The method of claim 1, further comprising:enumerating the resources in the second and third installation scopes.11. A system for associating installation scopes to facilitate updatinginstances of native resources, the system comprising: at least onecomputer processor programmed to: execute a first application within afirst isolation environment, mount an image of a second application,execute a third application within a second isolation environment;intercept a request to retrieve and update a native resource sent by thethird application associated with a third installation scope and locatedwithin the second isolation environment; determine that there is anassociation between the third installation scope and a secondinstallation scope representative of the image of the second applicationafter failing to locate, within the third installation scope, aninstance of a native resource corresponding to the requested nativeresource; retrieve an instance of the requested native resource, theinstance located within the second installation scope; update theretrieved instance of the requested native resource and returning theupdated native resource to the second installation scope; intercept arequest to retrieve the native resource, the request sent by the firstapplication associated with a first installation scope located withinthe first isolation environment; determine an association between thefirst installation scope and the second installation scope after failingto locate, within the first installation scope, a native resourcecorresponding to the requested native resource; retrieve an instance ofthe updated native resource located within the second installationscope; and return the updated native resource to the first application.12. The system of claim 11, wherein the image of the second applicationis mounted within the first isolation environment.
 13. The system ofclaim 11, wherein the image of the second application is mounted withinthe second isolation environment.
 14. The system of claim 11, whereinthe at least one computer processor is further programmed to: create theassociation between the first and second installation scopes.
 15. Themethod of claim 11, wherein the at least one computer processor isfurther programmed to: create the association between the second andthird installation scopes.
 16. The method of claim 11, wherein the atleast one computer processor is further programmed to: create anassociation between the first, second, and third installation scopes.17. The method of claim 11, wherein the association between the thirdand second installation scopes is also an association with the firstinstallation scope.
 18. The method of claim 11, wherein the associationbetween the first and second installation scopes is also an associationwith the third installation scope.
 19. The method of claim 11, whereinthe at least one computer processor is further programmed to: enumeratethe resources in the first and second installation scopes.
 20. Themethod of claim 11, wherein the at least one computer processor isfurther programmed to: enumerate the resources in the second and thirdinstallation scopes.